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
…orkflow.
  • Loading branch information
lapets committed Apr 17, 2022
1 parent 6984fc6 commit d0947cc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 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 @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
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 @@ -18,9 +18,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 nthcommunity # 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 @@ -165,15 +165,15 @@ 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

Style conventions are enforced using `Pylint <https://www.pylint.org/>`_::

python -m pip install pylint
pylint nthcommunity test/test_nthcommunity.py
python -m pylint nthcommunity test/test_nthcommunity.py

Contributions
-------------
Expand All @@ -182,3 +182,16 @@ In order to contribute to the source code, open an issue or submit a pull reques
Versioning
----------
Beginning with version 0.1.0, 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/nthcommunity/>`_ 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=nthcommunity
tests=nthcommunity/nthcommunity.py,test/
[tool:pytest]
addopts = --doctest-modules --ignore=docs --cov=nthcommunity --cov-report term-missing
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@
"secure data collaboration platform.",
long_description=long_description,
long_description_content_type="text/x-rst",
test_suite="nose.collector",
tests_require=["nose"],
)

0 comments on commit d0947cc

Please sign in to comment.