Skip to content

Commit

Permalink
Updated dev tools and dev environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-hen committed Aug 27, 2022
1 parent 05a0fb5 commit ba6e4b9
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 47 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v2
uses: actions/checkout@v3

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

- name: Install package.
run: |
pip install --upgrade pip
pip install .[test,docs]
pip install flit
run: pip install .[dev]

- name: Lint code.
run: flake8p
run: flake8

- name: Run tests.
run: pytest
run: pytest

- name: Build package.
run: python tools/wheel.py
run: python tools/wheel.py

- name: Render docs.
run: python tools/docs.py
run: python tools/docs.py

- name: Clean repo.
run: python tools/clean.py
run: python tools/clean.py
File renamed without changes.
67 changes: 41 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Meta information: PyPI and pip
# Project information: PyPI and pip

[project]
name = 'KDE-diffusion'
Expand All @@ -14,14 +14,26 @@ classifiers = [
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
]
readme = 'pypi.md'
requires-python = '>=3.6'
dependencies = ['NumPy', 'SciPy']
readme = 'PyPI.md'
dynamic = ['version', 'description']
requires-python = '>= 3.6'
dependencies = [
'NumPy',
'SciPy',
]

[project.optional-dependencies]
docs = ['Sphinx', 'Furo', 'MyST-parser', 'Commonmark']
test = ['pyTest', 'pyTest-cov', 'coverage-badge', 'Flake8', 'Flake8-pyproject']
dev = [
'pyTest',
'pyTest-cov',
'coverage-badge',
'Flake8-pyproject',
'Sphinx',
'Furo',
'MyST-parser',
'Commonmark',
'Flit',
]

[project.urls]
Documentation = 'https://kde-diffusion.readthedocs.io'
Expand All @@ -31,45 +43,48 @@ Source = 'https://github.com/john-hen/kde-diffusion'
# Wheel builder: flit

[build-system]
requires = ['flit_core >=2,<4']
requires = ['flit_core >= 2, < 4']
build-backend = 'flit_core.buildapi'

[tool.flit.module]
name = 'kde_diffusion'


# Code linter: Flake8 (via pyproject-Flake8)
# Code linter: Flake8

[tool.flake8]
exclude = [
'.git',
'__pycache__',
'develop',
'local',
'ignore',
]
ignore = [
'E127', 'E128',
'E201', 'E202',
'E221', 'E222',
'E226',
'E231',
'E241',
'E251',
'E261',
'E271', 'E272',
'E302', 'E305',
'E402',
'W503',
'E741',
'E127', # Continuation line over-indented for visual indent.
'E128', # Continuation line under-indented for visual indent.
'E201', # Whitespace after '('.
'E202', # Whitespace before ')'.
'E221', # Multiple spaces before operator.
'E222', # Multiple spaces after operator.
'E226', # Missing whitespace around arithmetic operator.
'E231', # Missing whitespace after ',', ';', or ':'.
'E241', # Multiple spaces after ','.
'E251', # Unexpected spaces around keyword / parameter equals.
'E261', # At least two spaces before inline comment.
'E271', # Multiple spaces after keyword.
'E272', # Multiple spaces before keyword.
'E402', # Module level import not at top of file.
'E741', # Ambiguous variable name 'l'.
'W503', # Line break occurred before a binary operator.
]
per-file-ignores = [
'__init__.py:F401', # Imported but unused.
]
per-file-ignores = ['__init__.py:F401']


# Test runner: pyTest

[tool.pytest.ini_options]
addopts = '--verbose'
testpaths = ['tests']
filterwarnings = ['ignore::UserWarning']


# Code coverage: Coverage.py
Expand Down
15 changes: 15 additions & 0 deletions tools/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Tools automating tasks during local development


Steps to take when releasing a new version:
* Bump version number in `mph/meta.py`.
* Add dedicated commit for the version bump.
* Tag commit with version number, e.g. `git tag v1.0.4`.
* Run code linter: `flake8`.
* Run code coverage: `python tools/coverage.py`.
* Test docs build: `python tools/docs.py`.
* Test wheel build: `python tools/wheel.py`.
* Push to GitHub: `git push && git push --tags`.
* Check documentation build on Read-the-Docs.
* Create new release on GitHub and add release notes.
* Publish to PyPI: `python tools/publish.py`.
10 changes: 0 additions & 10 deletions tools/release.md

This file was deleted.

0 comments on commit ba6e4b9

Please sign in to comment.