diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3acf1ae..b46bca1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,8 +24,8 @@ jobs: - name: Run tests run: | pytest - - name: Upload coverage + - name: Upload coverage report uses: actions/upload-artifact@v4 with: name: coverage-${{ matrix.python-version }} - path: .coverage \ No newline at end of file + path: artefacts/reports/ diff --git a/README.md b/README.md index 043f656..8f0e8ae 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Currently this requires Python 3.8+ but the version requirements can drop a coup ## Development -Run the tests and linting with `pytest`. Pushes have the test suite run against them, and will also publish a release if tagged thanks to GitHub Actions. You can reproduce the Actions locally using [act](https://github.com/nektos/act), e.g. `TWINE_USERNAME= TWINE_PASSWORD= act`. +Install the development dependencies with `pip install --editable .[test]` and run the tests and linting with `pytest`. Pushes have the test suite run against them, and will also publish a release if tagged thanks to GitHub Actions. You can reproduce the Actions locally using [act](https://github.com/nektos/act), e.g. `TWINE_USERNAME= TWINE_PASSWORD= act`. If you want to run a subset of tests or otherwise pass arguments to pytest, just invoke `pytest` directly, e.g.: ```sh diff --git a/pytest b/pytest deleted file mode 100755 index 711ac61..0000000 --- a/pytest +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -:<<"DOC" -Wrapper script for pytest which uses pytest-runner. This lets you avoid running all tests at once as would happen with `python setup.py test`. - -This depends on the requirements being explicitly state in setup.py and not imported/loaded from elsewhere. - -DOC -set -o pipefail -o errexit -o nounset -here="$(cd "$(dirname "$0")" && pwd)" -cd "$here" - - -# download packages if they aren't ready, or if they might have changed -if ! [[ -d ".eggs/" ]] || [[ setup.py -nt ".eggs/$(ls -tr .eggs/ | tail -n1)" ]]; then - # make sure eggs are installed - echo "Downloading required packages" - rm -fr ".eggs/" - python3 setup.py pytest --dry-run -fi - -PYTHONPATH="$(echo .eggs/*.egg|tr ' ' ':')" exec python3 -m pytest "$@" diff --git a/setup.py b/setup.py deleted file mode 100644 index 0cdfa65..0000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Script for testing and packaging this library.""" -import codecs -import os -from textwrap import dedent - -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) - -with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() - -TEST_REQUIRES = [ - "flake8-black", - "flake8-docstrings", - "flake8-isort", - "pytest-cov>=2.6.1", - "pytest-ruff", - "pytest-mypy", - "pytest>=4.1", -] -setup( - author="Oliver Bristow", - author_email="github+pypi@oliverbristow.co.uk", - name="modello", - use_scm_version=True, - install_requires=["sympy"], - long_description=long_description, - long_description_content_type="text/markdown", - description="sympy expressions in models", - setup_requires=["setuptools_scm", "wheel", "pytest-runner"], - tests_require=TEST_REQUIRES, - extras_require={"test": TEST_REQUIRES}, - py_modules=["modello"], - python_requires=">=3.7", - license="MIT", - classifiers=dedent( - """ - Development Status :: 4 - Beta - Intended Audience :: Developers - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - """ - ) - .strip() - .split("\n"), - keywords="symbolic modeling", - url="https://github.com/Code0x58/modello/", -)