Skip to content

Commit

Permalink
Pull request #142: 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 develop

* commit '02b19d03a731ff1b81871cc96ea650766aa207ce':
  bump: version 2.1.4 → 2.2.0
  Update docs on installation, widget; update Readme and Makefile
  Update optional dependencies; cleanup Makefile
  • Loading branch information
bonicim committed Mar 1, 2024
2 parents 6910e69 + 02b19d0 commit d31c24d
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 118 deletions.
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
43 changes: 26 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,79 +25,88 @@ flake8:
format:
@$(PYTHON3) -m black hypernetx


## Tests

.PHONY: pre-commit
pre-commit:
pre-commit install
pre-commit run --all-files


.PHONY: test
test:
coverage run --source=hypernetx -m pytest
coverage report -m

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

.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

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

## 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]' --use-pep517
@$(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]' --use-pep517
@$(PYTHON3) -m pip install .[releases] --use-pep517

.PHONY: version-deps

### Documentation

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

.PHONY: docs-deps

## Tutorials

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

.PHONY: tutorials
tutorials:
jupyter notebook tutorials



## 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);

Expand All @@ -107,16 +116,16 @@ ci-github-deps:

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

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

.PHONY: test-deps
test-deps:
@$(PYTHON3) -m pip install .'[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
45 changes: 18 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ conda activate venv-hnx


```shell
virtualenv env-hnx
source env-hnx/bin/activate
virtualenv venv-hnx
source venv-hnx/bin/activate
```


Expand Down Expand Up @@ -190,19 +190,11 @@ Ensure that you have [git](https://git-scm.com/book/en/v2/Getting-Started-Instal
```shell
git clone https://github.com/pnnl/HyperNetX.git
cd HyperNetX
make venv
source venv-hnx/bin/activate
pip install .
```

Post-Installation Actions
=========================

Running Tests
-------------

```shell
python -m pytest
```

Development
===========

Expand All @@ -213,10 +205,13 @@ Install an editable version
pip install -e .
```

Install an editable version with access to jupyter notebooks
------------------------------------------------------------
Install an editable version with supported applications
-------------------------------------------------------

```shell
pip install -e .['all']

# for zsh users
pip install -e .'[all]'
```

Expand All @@ -226,7 +221,7 @@ Install support for testing
> ℹ️ **NOTE:** This project has a pytest configuration file named 'pytest.ini'. By default, pytest will use those configuration settings to run tests.
```shell
pip install .'[testing]'
make test-deps

# run tests
python -m pytest
Expand All @@ -243,20 +238,14 @@ Install support for tutorials
-----------------------------

``` shell
pip install .'[tutorials]'
make tutorial-deps

# open Jupyter notebooks in a browser
make tutorials
```

Install support for documentation
---------------------------------

```shell
pip install .'[documentation]'
cd docs

## This will generate the documentation in /docs/build/
## Open them in your browser with docs/build/html/index.html
make html
```


Code Quality
Expand All @@ -269,7 +258,7 @@ HyperNetX uses a number of tools to maintain code quality:
Before using these tools, ensure that you install Pylint in your environment:

```shell
pip install .'[lint]'
make lint-deps
```


Expand Down Expand Up @@ -299,6 +288,7 @@ For more information on configuration, see https://pylint.pycqa.org/en/latest/us


```shell
make format-deps
black hypernetx
```

Expand All @@ -309,19 +299,20 @@ Build and view documentation locally
---------------------------

```
make docs-deps
cd docs
make html
open docs/build/html/index.html
```

Editing documentation
----------------------
NOTE: make sure you install the required dependencies using: `make docs-deps`

When editing documentation, you can auto-rebuild the documentation locally so that you can view your document changes
live on the browser without having to rebuild every time you have a change.

```
make docs-deps
cd docs
make livehtml
```
Expand Down
8 changes: 0 additions & 8 deletions docs/source/classes/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ classes package
Submodules
----------

classes.entity module
---------------------

.. automodule:: classes.entity
:members:
:undoc-members:
:show-inheritance:

classes.entityset module
------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os


__version__ = "2.1.4"
__version__ = "2.2.0"


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
Loading

0 comments on commit d31c24d

Please sign in to comment.