diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 22f0622..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[bumpversion] -current_version = 2.0.0 -commit = True -tag = True - -[bumpversion:file:setup.cfg] -search = version = {current_version} -replace = version = {new_version} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..a0aaa22 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,21 @@ +name: Pre-commit + +on: + pull_request: + push: + branches: [main] + + + +jobs: + check-code: + runs-on: ubuntu-24.04 + steps: + # This action sets the current path to the root of your github repo + - uses: actions/checkout@v6 + + - name: Install pre-commit + run: python3 -m pip install pre-commit + + - name: Run hooks + run: pre-commit run --all diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..45a3cb6 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,44 @@ +name: PyPI + +on: + push: + branches: + - "main" + tags: + - "v*" + pull_request: + branches: + - "main" + + +jobs: + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Build SDist and wheel + run: pipx run build + + - uses: actions/upload-artifact@v5 + with: + path: dist/* + + - name: Check metadata + run: pipx run twine check dist/* + + publish: + needs: [dist] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags') + environment: pypi + permissions: + id-token: write + + steps: + - uses: actions/download-artifact@v6 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index af62c93..fce6090 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -153,3 +153,20 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 + + +[tool.bumpversion] +allow_dirty = false +commit = true +message = "Bump version: {current_version} → {new_version}" +tag = true +sign_tags = false +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +current_version = "1.0.1" + + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = 'version = "{current_version}"' +replace = 'version = "{new_version}"' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1069188..0000000 --- a/setup.cfg +++ /dev/null @@ -1,86 +0,0 @@ -[metadata] -name = modelgraph -version = 2.0.0 -description = Tool for extracting dependency graphs from gotran ODE models -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/ComputationalPhysiology/modelgraph -author = Henrik Finsberg -author_email = henriknf@simula.no -license = MIT -license_files = LICENSE -classifiers = - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only -keywords = ODE, models, graphs, dependencies - -[options] -packages = find: -install_requires = - click - gotran - networkx - importlib-metadata;python_version<'3.8' -python_requires = >=3.10 -package_dir = - =src -zip_safe = False - -[options.packages.find] -where = src - -[options.extras_require] -dev = - Sphinx - black - build - bump2version - flake8 - ipython - isort - mypy - pdbpp - pip - pre-commit - sphinx - twine - wheel -docs = - Sphinx - jupytext - myst-parser - sphinx-press-theme -gui = - streamlit -plot = - matplotlib - pydot -test = - pytest - pytest-cov - -[flake8] -exclude = docs -ignore = E203, E266, E501, W503, E731 -max-line-length = 88 -max-complexity = 18 -select = B,C,E,F,W,T4 - -[aliases] -test = pytest - -[tool:pytest] -addopts = --cov=src/modelgraph --cov-report html --cov-report xml --cov-report term-missing -v -testpaths = - tests - -[mypy] -files = src/modelgraph,tests -ignore_missing_imports = true -exclude = docs - -[coverage:run] -omit = - src/modelgraph/gui.py - src/modelgraph/cli.py - src/modelgraph/__main__.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup()