Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 11 additions & 41 deletions .github/workflows/python-lint-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,11 @@ on:
- release/*

jobs:

###########
# LINTING #
###########
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
# Cache pip
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: ${{ runner.os }}-pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install mypy black isort
- name: Python Code Quality and Lint
uses: abey79/python-lint@master
with:
python-root-list: "pnoise tests"
use-pylint: false
use-pycodestyle: false
use-flake8: false
use-black: true
extra-black-options: --diff
use-mypy: true
use-isort: true

#########
# TESTS #
#########
tests:
needs: linting
lint-and-tests:
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
Expand All @@ -63,14 +24,23 @@ jobs:

steps:
- uses: actions/checkout@v2
name: Checkout code

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install .
pip install -r dev-requirements.txt

- name: Lint
run: |
black --check --diff pnoise tests
isort --check --diff pnoise tests

- name: Pytest
run: |
pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ celerybeat.pid
.env
.venv
env/
venv/
venv*/
ENV/
env.bak/
venv.bak/
Expand Down
7 changes: 5 additions & 2 deletions pnoise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@


def _get_version() -> str:
import pkg_resources
try:
from importlib.metadata import version
except ModuleNotFoundError:
from importlib_metadata import version

return pkg_resources.get_distribution("pnoise").version
return version(__name__)


__version__ = _get_version()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
python_requires=">=3.6",
install_requires=[
"numpy>=1.19",
"setuptools",
"importlib_metadata;python_version<'3.8'",
],
classifiers=[
"License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
Expand Down