Skip to content

Commit

Permalink
Test using pytest; update README, package files, and GitHub Actions w…
Browse files Browse the repository at this point in the history
…orkflows.
  • Loading branch information
lapets committed Mar 23, 2022
1 parent 5994dae commit adbe2ea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint-test-cover-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']
name: "Python ${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v2
Expand All @@ -17,9 +17,9 @@ jobs:
architecture: x64
- name: Lint and test module.
run: |
pip install -U pylint coverage nose .
pip install -U pylint pytest pytest-cov .
python -m pylint datatask # Check against linting rules.
python -m nose --cover-erase # Test using nose.
python -m pytest # Run tests.
- name: Publish coverage results.
run: |
pip install -U pylint coveralls
Expand Down
21 changes: 17 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ The documentation can be generated automatically from the source files using `Sp

Testing and Conventions
-----------------------
All unit tests are executed and their coverage is measured when using `nose <https://nose.readthedocs.io/>`_ (see ``setup.cfg`` for configuration details)::
All unit tests are executed and their coverage is measured when using `pytest <https://docs.pytest.org/>`_ (see ``setup.cfg`` for configuration details)::

python -m pip install nose coverage
nosetests --cover-erase
python -m pip install pytest pytest-cov
python -m pytest

Alternatively, all unit tests are included in the module itself and can be executed using `doctest <https://docs.python.org/3/library/doctest.html>`_::

Expand All @@ -213,7 +213,7 @@ Alternatively, all unit tests are included in the module itself and can be execu
Style conventions are enforced using `Pylint <https://www.pylint.org/>`_::

python -m pip install pylint
pylint datatask
python -m pylint datatask

Contributions
-------------
Expand All @@ -222,3 +222,16 @@ In order to contribute to the source code, open an issue or submit a pull reques
Versioning
----------
The version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 <https://semver.org/#semantic-versioning-200>`_.

Publishing
----------
This library can be published as a `package on PyPI <https://pypi.org/project/datatask/>`_ by a package maintainer. Install the `wheel <https://pypi.org/project/wheel/>`_ package, remove any old build/distribution files, and package the source into a distribution archive::

python -m pip install wheel
rm -rf dist *.egg-info
python setup.py sdist bdist_wheel

Next, install the `twine <https://pypi.org/project/twine/>`_ package and upload the package distribution archive to PyPI::

python -m pip install twine
python -m twine upload dist/*
8 changes: 2 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
[nosetests]
exe=True
with-doctest=1
with-coverage=1
cover-package=datatask
tests=datatask/datatask.py
[tool:pytest]
addopts = --doctest-modules --ignore=docs --cov=datatask --cov-report term-missing
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# The lines below can be parsed by `docs/conf.py`.
name = "datatask"
version = "0.1.0"
version = "0.2.0"

setup(
name=name,
Expand All @@ -21,6 +21,4 @@
"that involve multiple data resources.",
long_description=long_description,
long_description_content_type="text/x-rst",
test_suite="nose.collector",
tests_require=["nose"],
)

0 comments on commit adbe2ea

Please sign in to comment.