diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..d4dd51ed --- /dev/null +++ b/.flake8 @@ -0,0 +1,12 @@ +[flake8] +max_line_length = 120 +ignore = + # allow empty line at end of file + W391, + # break before binary operator - allow either style + W503, + # break after binary operator - allow either style + W504, +exclude = + .git, + venv diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b2d1b91c..52e0dec2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: python -m pytest --cov --cov-config=.coveragerc - name: Submit report to codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v7 with: token: ${{ secrets.CODECOV_TOKEN }} if: success() diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index ebc24701..4977a6c3 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -25,5 +25,5 @@ jobs: - name: Check imports are ordered correctly run: | - python -m isort --verbose --check-only --diff cellmlmanip tests setup.py + python -m isort --verbose --check-only --diff cellmlmanip tests diff --git a/pyproject.toml b/pyproject.toml index 7b959378..7dc687b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,70 @@ [build-system] requires = ["setuptools>=64", "wheel"] build-backend = "setuptools.build_meta" + +[project] +name = "cellmlmanip" +description = "CellML loading and model equation manipulation" +readme = "README.md" +requires-python = ">=3.10" +authors = [ + {name = "Asif U Tamuri"}, + {name = "Sarah M Keating"}, + {name = "Maurice Hendrix"}, + {name = "Michael Clerx"}, + {name = "Jonathan Cooper", email = "j.p.cooper@ucl.ac.uk"}, +] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", +] +dependencies = [ + "lxml>=4.7", + "networkx>=2.1", + "Pint>=0.24, <0.26", + "rdflib>=4", + "sympy>=1.4, <1.13", +] +dynamic = ["version"] + +[project.optional-dependencies] +docs = [ + "sphinx>=2.0", +] +test = [ + "flake8", + "isort", + "pytest>=6.0", + "pytest-cov", +] + +[project.urls] +Homepage = "https://github.com/ModellingWebLab/cellmlmanip" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "cellmlmanip/version.txt"} + +[tool.setuptools.packages.find] +exclude = ["tests*", "docs*"] + +[tool.isort] +line_length = 120 +multi_line_output = 3 +# ^ Vertical Hanging Indent +force_grid_wrap = 4 +# ^ Don't allow more than 3 imports on a single line +lines_after_imports = 2 +order_by_type = true +include_trailing_comma = true +force_single_line = false +default_section = "THIRDPARTY" +known_first_party = ["cellmlmanip"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index bd511cfd..00000000 --- a/setup.cfg +++ /dev/null @@ -1,27 +0,0 @@ -[flake8] -max_line_length = 120 -ignore = - # allow empty line at end of file - W391, - # break before binary operator - allow either style - W503, - # break after binary operator - allow either style - W504, -exclude = - .git, - venv - -[isort] -line_length = 120 -multi_line_output = 3 -# ^ Vertical Hanging Indent -force_grid_wrap = 4 -# ^ Don't allow more than 3 imports on a single line -lines_after_imports = 2 -order_by_type = True -include_trailing_comma = True -force_single_line = False - -default_section = THIRDPARTY -known_first_party = cellmlmanip -skip = diff --git a/setup.py b/setup.py deleted file mode 100644 index b97b0c91..00000000 --- a/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -import os - -from setuptools import find_packages, setup - - -# Load README -with open('README.md') as f: - readme = f.read() - -# Load version number -with open(os.path.join('cellmlmanip', 'version.txt'), 'r') as f: - version = f.read() - -setup( - name='cellmlmanip', - version=version, - description='CellML loading and model equation manipulation', - long_description=readme, - long_description_content_type='text/markdown', - author='Asif U Tamuri, Sarah M Keating, Maurice Hendrix, Michael Clerx, Jonathan Cooper', - author_email='j.p.cooper@ucl.ac.uk', - url='https://github.com/ModellingWebLab/cellmlmanip', - classifiers=[ - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: 3.14', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - ], - - packages=find_packages(exclude=('tests', 'docs')), - include_package_data=True, - python_requires='>=3.10', - install_requires=[ - 'lxml>=4.7', - 'networkx>=2.1', - 'Pint>=0.24, <0.26', - 'rdflib>=4', - 'sympy>=1.4, <1.13', - ], - extras_require={ - 'docs': [ - 'sphinx>=2.0', - ], - 'test': [ - 'flake8', - 'isort', - 'pytest>=6.0', - 'pytest-cov', - ], - }, -)