Skip to content

Commit

Permalink
Use Poetry for project management
Browse files Browse the repository at this point in the history
  • Loading branch information
espdev committed Dec 17, 2023
1 parent 33f07d7 commit 3078d50
Show file tree
Hide file tree
Showing 8 changed files with 1,602 additions and 125 deletions.
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

70 changes: 36 additions & 34 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,53 @@ jobs:
strategy:
max-parallel: 8
matrix:
platform:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
platform: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
poetry-version: [ "1.7.1" ]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Checkout project
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[tests]
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Unit Tests
run: pytest -v --color=yes --cov=csaps --cov-report=term --cov-report=lcov:coverage.info
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Coveralls
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
uses: coverallsapp/github-action@v2
- name: Define a cache for the virtual environment based on the dependencies lock file
uses: actions/cache@v3
with:
format: lcov
file: coverage.info
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: flake8 Static Analysis
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
run: flake8 csaps/ tests/ setup.py
- name: Install the project dependencies
run: poetry install

docs:
runs-on: ubuntu-latest
- name: Ruff static analysis
run: poetry run ruff check .

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Run tests
run: poetry run pytest -v --color=yes --cov=csaps --cov-report=term --cov-report=lcov:coverage.info

- name: Send coverage report to Coveralls
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
uses: coverallsapp/github-action@v2
with:
python-version: "3.11"
format: lcov
file: coverage.info

- name: Install dependencies
- name: Build docs
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[docs]
- name: Build Docs
run: make -C docs/ html
poetry shell
make -C docs/ html
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

7 changes: 5 additions & 2 deletions csaps/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
from importlib.metadata import PackageNotFoundError, version

__version__ = '1.1.0'
try:
__version__ = version('csaps')
except PackageNotFoundError: # pragma: no cover
__version__ = '0.0.0.dev0'
7 changes: 0 additions & 7 deletions mypy.ini

This file was deleted.

1,459 changes: 1,459 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[tool.poetry]
name = "csaps"
version = "1.2.0"
description = "Cubic spline approximation (smoothing)"
authors = ["Evgeny Prilepin <[email protected]>"]
license = "MIT"
readme = "README.md"

homepage = "https://github.com/espdev/csaps"
repository = "https://github.com/espdev/csaps"
documentation = "https://csaps.readthedocs.io"

keywords = ["cubic", "spline", "approximation", "smoothing", "interpolation", "csaps"]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Software Development :: Libraries",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: Implementation :: CPython",
]

include = [
"LICENSE",
"CHANGELOG.md",
"CONTRIBUTORS.txt",
]

packages = [
{include = "csaps"}
]


[tool.poetry.dependencies]
python = ">=3.8"
numpy = [
{version = "*", python = "<3.12"},
{version = ">=1.26.2", python = ">=3.12"},
]
scipy = [
{version = "*", python = "<3.12"},
{version = ">=1.11.4", python = ">=3.12"},
]


[tool.poetry.group.dev.dependencies]
setuptools = "^69.0.2"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"
m2r2 = "^0.3.2"
sphinx = "^7.1.2"
numpydoc = "^1.6.0"
matplotlib = "^3.7.4"
ruff = "^0.1.8"
mypy = "^1.7.1"


[build-system]
requires = ["poetry-core", "setuptools"]
build-backend = "poetry.core.masonry.api"


[tool.ruff]
target-version = "py38"
line-length = 120
select = [
"E", # All pycodestyle errors
"W", # All pycodestyle warnings
"F", # All Pyflakes errors
"A", # All flake8-builtins
"T201", # print found
"T203", # pprint found
]
ignore = [
"A001",
]
exclude = [
".ruff_cache",
".venv",
]


[tool.mypy]
python_version = "3.8"

[[tool.mypy.overrides]]
module = [
"numpy",
"scipy"
]
ignore_missing_imports = true
72 changes: 0 additions & 72 deletions setup.py

This file was deleted.

0 comments on commit 3078d50

Please sign in to comment.