-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #75 -- Update packaging and CI to PEP518
Close #74
- Loading branch information
Showing
11 changed files
with
250 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
charset = utf-8 | ||
end_of_line = lf | ||
max_line_length = 88 | ||
|
||
[*.{json,yml,yaml,toml}] | ||
indent_size = 2 | ||
|
||
[LICENSE] | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- 3.x | ||
pull_request: | ||
|
||
jobs: | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
lint-command: | ||
- bandit -r . -x ./tests | ||
- black --check --diff . | ||
- flake8 . | ||
- isort --check-only --diff . | ||
- pydocstyle . | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
cache: 'pip' | ||
cache-dependency-path: 'linter-requirements.txt' | ||
- run: python -m pip install -r linter-requirements.txt | ||
- run: ${{ matrix.lint-command }} | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.11 | ||
- run: sudo apt-get install -y graphviz | ||
- run: python -m pip install -e '.[docs]' | ||
- run: python -m sphinx -W -b html docs docs/_build | ||
|
||
dist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- run: python -m pip install --upgrade pip build wheel twine | ||
- run: python -m build --sdist --wheel | ||
- run: python -m twine check dist/* | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/* | ||
|
||
pytest: | ||
needs: | ||
- lint | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
python-version: | ||
- 3.7 | ||
- 3.8 | ||
- 3.9 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: python -m pip install .[test] | ||
- run: python -m pytest | ||
- uses: codecov/codecov-action@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
|
||
PyPi: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- run: python -m pip install --upgrade pip build wheel twine | ||
- run: python -m build --sdist --wheel | ||
- run: python -m twine upload dist/* | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,7 @@ dist/ | |
include/ | ||
lib/ | ||
docs/_build/ | ||
.coverage | ||
|
||
# packaging | ||
measurement/_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
version: 2 | ||
|
||
build: | ||
os: ubuntu-20.04 | ||
tools: | ||
python: "3.11" | ||
apt_packages: | ||
- graphviz | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bandit==1.7.4 | ||
black==22.10.0 | ||
flake8==5.0.4 | ||
isort==5.10.1 | ||
pydocstyle[toml]==6.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Easily use and manipulate unit-aware measurements in Python.""" | ||
|
||
from . import _version | ||
|
||
__version__ = _version.version | ||
VERSION = _version.version_tuple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[build-system] | ||
requires = ["flit_core>=3.2", "flit_scm", "wheel"] | ||
build-backend = "flit_scm:buildapi" | ||
|
||
[project] | ||
name = "measurement" | ||
authors = [ | ||
{ name = "Adam Coddington", email = "[email protected]" }, | ||
{ name = "Johannes Maron", email = "[email protected]" } | ||
] | ||
readme = "README.rst" | ||
license = { file = "LICENSE" } | ||
dynamic = ["version", "description"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: JavaScript", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Topic :: Software Development", | ||
"Topic :: Utilities", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Scientific/Engineering :: Astronomy", | ||
"Topic :: Scientific/Engineering :: Atmospheric Science", | ||
"Topic :: Scientific/Engineering :: Chemistry", | ||
"Topic :: Scientific/Engineering :: GIS", | ||
"Topic :: Scientific/Engineering :: Mathematics", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"Topic :: Software Development :: Localization", | ||
] | ||
keywords = [ | ||
"measurement", | ||
] | ||
requires-python = ">=3.7" | ||
dependencies = [] | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest", | ||
"pytest-cov", | ||
] | ||
docs = [ | ||
"sphinx", | ||
"python-docs-theme", | ||
] | ||
|
||
[project.urls] | ||
Project-URL = "http://github.com/coddingtonbear/python-measurement" | ||
|
||
[tool.flit.module] | ||
name = "measurement" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "measurement/_version.py" | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "--doctest-glob=*.rst --doctest-modules --cov=measurement" | ||
testpaths = [ | ||
"tests", | ||
] | ||
|
||
[tool.coverage.report] | ||
show_missing = true | ||
|
||
[tool.isort] | ||
atomic = true | ||
line_length = 88 | ||
known_first_party = "measurement, tests" | ||
include_trailing_comma = true | ||
default_section = "THIRDPARTY" | ||
combine_as_imports = true | ||
|
||
[tool.pydocstyle] | ||
add_ignore = "D1" | ||
match_dir = "(?!tests|env|docs|\\.).*" | ||
match = "(?!setup).*.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,4 @@ | ||
[metadata] | ||
name = measurement | ||
author = Adam Coddington | ||
author_email = [email protected] | ||
description = Easily use and manipulate unit-aware measurements in Python | ||
long_description = file: README.rst | ||
url = http://github.com/coddingtonbear/python-measurement | ||
license = MIT | ||
license_file = LICENSE | ||
classifier = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: MIT License | ||
Operating System :: OS Independent | ||
Programming Language :: Python | ||
Programming Language :: Python :: 2 | ||
Programming Language :: Python :: 3 | ||
Topic :: Utilities | ||
keywords = | ||
measurement | ||
|
||
[options] | ||
packages = find: | ||
include_package_data = True | ||
install_requires = | ||
sympy>=0.7.3 | ||
setup_requires = | ||
setuptools_scm | ||
sphinx | ||
pytest-runner | ||
tests_require = | ||
pytest | ||
|
||
[options.packages.find] | ||
exclude = | ||
tests | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[aliases] | ||
test = pytest | ||
|
||
[build_sphinx] | ||
source-dir = docs | ||
build-dir = docs/_build | ||
[flake8] | ||
max-line-length=88 | ||
select = C,E,F,W,B,B950 | ||
ignore = E203, E501, W503, E731 |
@codingjoe it looks like you forgot to add
sympy
as dependency here.3.2.x needs it, 4.0 doesn't