Skip to content

Commit

Permalink
Pull request #141: Release/v2.2.0
Browse files Browse the repository at this point in the history
Merge in HYP/hypernetx from release/v2.2.0 to master

* commit '02b19d03a731ff1b81871cc96ea650766aa207ce': (76 commits)
  bump: version 2.1.4 → 2.2.0
  Update docs on installation, widget; update Readme and Makefile
  Update optional dependencies; cleanup Makefile
  Fix tests
  Update installation instructions for widget
  Add images
  Move incidence visualization to tutorial 2
  Fix function call to updated draw function
  Run linter
  Use HNX for ingesting incidence matrix. Also uses HNX to store/access cell weights.
  Modification of draw function to support drawing the star hypergraph
  HYP-365 Silence warnings in tutorials
  Run linter
  removed readded test module
  updated empty hypergraph to have dataframes for properties
  HYP-360 Improve code quality tooling; update Makefile
  Remove unnecessary dependencies for documentation
  Update nb2plots
  Fix github workflow for documentation
  Update tests for soon to be deprecated translate methods
  ...
  • Loading branch information
bonicim authored and brendapraggastis committed Mar 1, 2024
2 parents 87be2bc + 02b19d0 commit 706d842
Show file tree
Hide file tree
Showing 64 changed files with 3,924 additions and 2,652 deletions.
6 changes: 5 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[run]
omit = */tests/*
omit =
*/tests/*
*/utils/toys/*
*/utils/log.py

[report]
exclude_lines =
_log
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "2.1.4"
version = "2.2.0"
version_files = [
"setup.py",
"docs/source/conf.py",
Expand Down
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
max-line-length=120
extend-ignore = E203
exclude =
.git,
__pycache__,
docs/source/conf.py,
old,
build,
dist
max-complexity = 10
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ jobs:
- name: Run tests
run: |
make test-ci-github
- name: Install documentation dependencies
run: |
pip install sphinx sphinx_rtd_theme
pip install .'[documentation]'
- name: Check documentation build
run: |
sphinx-build docs/source _build
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Docs
on: [push, pull_request, workflow_dispatch]
on: [push, workflow_dispatch]
permissions:
contents: write
jobs:
Expand All @@ -10,12 +10,12 @@ jobs:
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme
pip install .'[documentation]'
- name: Sphinx build
run: |
sphinx-build docs/source _build
- name: Deploy
if: github.head_ref == 'master'
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dist/
*.egg-info*
.tox/
venv*
.coverage
.coverage*
.idea
*env*
.venv*
Expand Down
28 changes: 0 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,3 @@ repos:
- id: trailing-whitespace
exclude: ^(docs/|hypernetx.egg-info/|setup.cfg)
- id: check-merge-conflict

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
exclude: ^(docs/|hypernetx.egg-info/)

# TODO: Uncomment once typing issues have been resolved and mypy has been
# correctly configured
#- repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.910-1
# hooks:
# - id: mypy
# exclude: (?x)(docs/|tests/)
# args: [--no-strict-optional, --ignore-missing-imports]

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"--rcfile=.pylintrc",
"--exit-zero" # Always return a 0 (non-error) status code, even if lint errors are found. This is primarily useful in continuous integration scripts.
]
13 changes: 0 additions & 13 deletions .pylintrc

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include hypernetx/utils/toys/HarryPotter_Characters.csv
101 changes: 78 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,76 +1,131 @@
SHELL = /bin/bash

VENV = venv-hnx
PYTHON_VENV = $(VENV)/bin/python3
PYTHON3 = python3


## Test
## Lint

test: test-deps
@$(PYTHON3) -m tox
.PHONY: lint
lint: pylint flake8 mypy

test-ci: test-deps
@$(PYTHON3) -m pip install 'pytest-github-actions-annotate-failures>=0.1.7'
.PHONY: pylint
pylint:
@$(PYTHON3) -m pylint --recursive=y --persistent=n --verbose hypernetx

.PHONY: mypy
mypy:
@$(PYTHON3) -m mypy hypernetx || true

.PHONY: flake8
flake8:
@$(PYTHON3) -m flake8 hypernetx --exit-zero

.PHONY: format
format:
@$(PYTHON3) -m black hypernetx


## Tests

.PHONY: pre-commit
pre-commit:
pre-commit install
pre-commit run --all-files
@$(PYTHON3) -m tox -e py38 -r
@$(PYTHON3) -m tox -e py38-notebooks -r

test-ci-github: test-deps
@$(PYTHON3) -m pip install 'pytest-github-actions-annotate-failures>=0.1.7'
.PHONY: test
test:
coverage run --source=hypernetx -m pytest
coverage report -m

.PHONY: test-ci
test-ci:
@$(PYTHON3) -m tox

.PHONY: test, test-ci, test-ci-github
.PHONY: test-ci-stash
test-ci-stash: lint-deps lint pre-commit test-deps test-ci


.PHONY: test-ci-github
test-ci-github: lint-deps lint pre-commit ci-github-deps test-deps test-ci


## Continuous Deployment
## Assumes that scripts are run on a container or test server VM

### Publish to PyPi

.PHONY: publish-deps
publish-deps:
@$(PYTHON3) -m pip install -e .'[packaging]'
@$(PYTHON3) -m pip install -e .[packaging] --use-pep517

.PHONY: build-dist
build-dist: publish-deps clean
@$(PYTHON3) -m build --wheel --sdist
@$(PYTHON3) -m twine check dist/*

## Assumes the following environment variables are set: TWINE_USERNAME, TWINE_PASSWORD, TWINE_REPOSITORY_URL,
## See https://twine.readthedocs.io/en/stable/#environment-variables
.PHONY: publish-to-pypi
publish-to-pypi: publish-deps build-dist
@echo "Publishing to PyPi"
$(PYTHON3) -m twine upload dist/*

.PHONY: build-dist publish-to-pypi publish-deps

### Update version

.PHONY: version-deps
version-deps:
@$(PYTHON3) -m pip install .'[releases]'
@$(PYTHON3) -m pip install .[releases] --use-pep517

.PHONY: version-deps

#### Documentation
### Documentation

.PHONY: docs-deps
docs-deps:
@$(PYTHON3) -m pip install -e .'[documentation]' --use-pep517
@$(PYTHON3) -m pip install .[documentation] --use-pep517


## Tutorials

.PHONY: tutorial-deps
tutorial-deps:
@$(PYTHON3) -m pip install .[tutorials] .[widget] --use-pep517

.PHONY: tutorials
tutorials:
jupyter notebook tutorials

.PHONY: docs-deps

## Environment

.PHONY: clean-venv
clean-venv:
rm -rf $(VENV)

.PHONY: clean
clean:
rm -rf .out .pytest_cache .tox *.egg-info dist build

.PHONY: venv
venv: clean-venv
@$(PYTHON3) -m venv $(VENV);

.PHONY: github-ci-deps
ci-github-deps:
@$(PYTHON3) -m pip install 'pytest-github-actions-annotate-failures>=0.1.7'

.PHONY: lint-deps
lint-deps:
@$(PYTHON3) -m pip install .[lint] --use-pep517

.PHONY: format-deps
format-deps:
@$(PYTHON3) -m pip install .[format] --use-pep517

.PHONY: test-deps
test-deps:
@$(PYTHON3) -m pip install -e .'[testing]' --use-pep517
@$(PYTHON3) -m pip install .[testing] --use-pep517

.PHONY: all-deps
all-deps:
@$(PYTHON3) -m pip install -e .'[all]' --use-pep517

.PHONY: clean clean-venv venv all-deps test-deps
@$(PYTHON3) -m pip install .[all] --use-pep517
Loading

0 comments on commit 706d842

Please sign in to comment.