Skip to content

Commit

Permalink
Pull request #189: Release/2.3.2
Browse files Browse the repository at this point in the history
Merge in HYP/hypernetx from release/2.3.2 to master

* commit '21b0f6bf044df4138b42fc995653a47e77847f6a':
  bump: version 2.3.1 → 2.3.2
  Fix typos in documentation
  Fix readthdocs script; update publish to pypi workflow
  Modify documentation CI workflow
  Modify constraint python version
  Remove CI scripts from Makefile, Readme
  Remove celluloid, igraph from requirements.txt
  Make decorator dependency loosely constrained
  Remove poetry.lock
  Update github workflow
  • Loading branch information
bonicim committed May 29, 2024
2 parents 0fffb4c + 21b0f6b commit 4741612
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 4,493 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.3.1"
version = "2.3.2"
version_files = [
"pyproject.toml",
"docs/source/conf.py",
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/documentation.yml

This file was deleted.

32 changes: 19 additions & 13 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses the Github Action, poetry-publish.
# It will build the HNX package into a wheel and sdist and then publish those artifacts to TestPyPi and PyPi using poetry.
# Documentation for this action is at: https://github.com/marketplace/actions/publish-python-poetry-package
# For building and publishing to PyPi in Github Workflows, see https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Publish HNX

on:
release:
Expand All @@ -22,23 +24,27 @@ permissions:
contents: read

jobs:
deploy:
publish-to-pypi:
runs-on: ubuntu-latest

steps:
- run: |
echo "This workflow was triggered by: $TRIGGER_PERSON"
env:
TRIGGER_PERSON: ${{ inputs.triggeredBy }}
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- run: echo "Building wheel from tag ${{ github.ref_name }}"
- run: echo "Building wheel from branch ${{ github.ref_name }}"

- uses: actions/checkout@v4

# - name: Build and publish distribution 📦 to Test PyPI
# uses: JRubics/[email protected]
# with:
# python_version: "3.11"
# pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_name: "testpypi"
# repository_url: "https://test.pypi.org/legacy/"
- name: Build and publish distribution 📦 to Test PyPI
uses: JRubics/[email protected]
with:
python_version: "3.11"
pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_name: "testpypi"
repository_url: "https://test.pypi.org/legacy/"

- name: Build and publish distribution 📦 to PyPI
uses: JRubics/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ cov.syspath.txt
*.whl
*dogsAndcats*
pytest_notebooks.xml
poetry.lock
24 changes: 15 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Uses poetry to install dependencies
# See https://docs.readthedocs.io/en/latest/build-customization.html#install-dependencies-with-poetry

# Required
version: 2
Expand All @@ -9,12 +11,24 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.10"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
Expand All @@ -24,11 +38,3 @@ formats:
- pdf
- htmlzip
- epub

# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- documentation
10 changes: 4 additions & 6 deletions LONG_DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ can be imported using their incidence dictionaries and/or property datafames.**
What's New
~~~~~~~~~~~~~~~~~~~~~~~~~
#. We've added new functionality to Hypergraphs; you can add and remove nodes, edges, and incidences on Hypergraph.
#. Arithmetic operations have also been added to Hypergraph: sum, difference, union, intersection
#. We've also added a new tutorial on basic hypergraph arithmetic operations
#. Under the hood, the EntitySet has been replaced by HypergraphView, new factory methods have been created to support
the Hypergraph constructor, and internal classes such as IncidenceStore and PropertyStore help maintain the structure
and attributes of a Hypergraph
#. Arithmetic operations have also been added to Hypergraph: sum, difference, union, intersection.
#. We've also added a new tutorial on basic hypergraph arithmetic operations.
#. Under the hood, the EntitySet has been replaced by HypergraphView, new factory methods have been created to support the Hypergraph constructor, and internal classes such as IncidenceStore and PropertyStore help maintain the structure and attributes of a Hypergraph.

What's Changed
~~~~~~~~~~~~~~~~~~~~~~~~~
#. Documentation has received a major update; the Glossary and docstrings of Hypergraph have been updated.
#. HNX now requires Python ^3.10,<=3.12
#. HNX now requires Python >=3.10,<4.0.0
#. We've upgraded all the underlying core libraries to the latest versions.
81 changes: 18 additions & 63 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PYTHON3 = python3

############# Manage Environments #############

## Environment using Pip
## Create environment using Pip
.PHONY: venv
venv: clean-venv
@$(PYTHON3) -m venv $(VENV);
Expand All @@ -19,19 +19,28 @@ install:
@$(PYTHON3) -m pip install -e .
@$(PYTHON3) -m pip install -r requirements.txt

## Environment using Poetry
## Create environment using Poetry

.PHONY: develop
develop: clean-poetry-env
poetry shell
.PHONY: install-with-poetry
install-with-poetry:
poetry env remove --all
poetry install --with test


## Create new requirements.txt from current poetry environment
.PHONY: requirements.txt
requirements.txt:
poetry export --format requirements.txt --output requirements.txt --without-hashes --with test,widget,tutorials,docs

############# Running Tests, linters #############
############# Tutorials #############
.PHONY: tutorials
tutorials:
jupyter notebook tutorials

.PHONY: clean
clean:
rm -rf .out .pytest_cache .tox *.egg-info dist build _build pytest.xml pytest_notebooks.xml .coverage

############# Running Tests, linters, formatters #############

## Tests
.PHONY: test
Expand All @@ -45,37 +54,12 @@ test-core:
coverage report -m


## Tests using Tox
## Run test on Tox framework
## Includes linting, running tests on jupyter notebooks
.PHONY: test-tox
test-tox:
@$(PYTHON3) -m tox --parallel

### Tests using Poetry + Tox
### Used by Bamboo CI Pipeline, Github Workflows CI Pipeline

.PHONY: test-ci-stash
test-ci-stash: install-poetry-stash run-poetry-tox clean-poetry-env

.PHONY: build-docs-stash
build-docs-stash: install-poetry-stash run-build-docs clean-poetry-env

.PHONY: install-poetry-stash
install-poetry-stash:
pip install poetry==1.8.2 tox

.PHONY: run-poetry-tox
run-poetry-tox:
tox --parallel

.PHONY: run-build-docs
run-build-docs:
tox -e build-docs

.PHONY: clean-poetry-env
clean-poetry-env:
poetry env remove --all

## Lint
.PHONY: lint
lint: pylint flake8
Expand All @@ -89,37 +73,8 @@ pylint:
flake8:
@$(PYTHON3) -m flake8 hypernetx --exit-zero

## precommit hooks that include formatter (Black)
.PHONY: pre-commit
pre-commit:
pre-commit install
pre-commit run --all-files

############# Packaging and Publishing to PyPi #############
## Uses Poetry to manage packaging and publishing
## Targets are included as a backup in case the Github Workflows CI can't publish to PyPi and we need to do it manually
## Assumes the following environment variables are set: PYPI_API_TOKEN
.PHONY: publish-to-pypi
publish-to-pypi: build check-long-desc
@echo "Publishing to PyPi"
poetry config pypi-token.pypi PYPI_API_TOKEN
poetry config repositories.pypi https://pypi.org/simple/
poetry publish --dry-run
#poetry publish

.PHONY: build
build: clean
poetry build

.PHONY: check-long-desc
check-long-desc:
poetry run pip install twine
poetry run twine check dist/*

############# Misc #############
.PHONY: tutorials
tutorials:
jupyter notebook tutorials

.PHONY: clean
clean:
rm -rf .out .pytest_cache .tox *.egg-info dist build _build pytest.xml pytest_notebooks.xml .coverage
Loading

0 comments on commit 4741612

Please sign in to comment.