-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move configuration into
pyproject.toml
(#36)
* move configuration into `pyproject.toml` * only test if distance is close (to account for floating point differences) * exclude Mac OSX + Python 3.10 Co-authored-by: zacharyburnett <[email protected]>
- Loading branch information
1 parent
78f5ba9
commit 818b0e5
Showing
8 changed files
with
174 additions
and
148 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 |
---|---|---|
|
@@ -6,62 +6,19 @@ on: | |
- published | ||
|
||
jobs: | ||
build_wheels: | ||
name: build wheel | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.x' ] | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v2 | ||
- name: install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: load cached Python installation | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.*') }} | ||
- name: build wheel | ||
run: pip wheel . -w dist --no-deps | ||
- name: save wheel | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build | ||
path: ./dist/*.whl | ||
build_sdist: | ||
name: package source | ||
publish: | ||
name: publish package to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v2 | ||
- name: install Python | ||
uses: actions/setup-python@v2 | ||
- name: install dependencies | ||
- name: install Poetry | ||
uses: abatilo/actions-poetry@v2.1.3 | ||
- name: install Dunamai | ||
run: pip install dunamai | ||
- name: package source | ||
run: python setup.py sdist | ||
- name: save source package | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build | ||
path: ./dist/*.tar.gz | ||
upload_pypi: | ||
name: publish to PyPI | ||
needs: [ build_wheels, build_sdist ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: retrieve wheel(s) and source | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: build | ||
path: dist | ||
- name: upload wheel(s) and source | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
- name: extract version from VCS | ||
run: poetry version $(dunamai from any) | ||
- name: build wheel and source | ||
run: poetry build | ||
- name: upload wheel and source | ||
run: poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }} |
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,6 +1,15 @@ | ||
name: tests | ||
|
||
on: [ push ] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.py' | ||
- '.github/workflows/tests.yml' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
|
@@ -11,22 +20,34 @@ jobs: | |
uses: actions/checkout@v2 | ||
- name: install Python | ||
uses: actions/setup-python@v2 | ||
- name: install flake8 | ||
run: pip install flake8 | ||
- name: load cached Python installation | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: install linters | ||
run: pip install flake8 oitnb | ||
- name: lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: lint with oitnb | ||
run: oitnb . --check | ||
test: | ||
needs: lint | ||
name: test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.6', '3.x' ] | ||
os: [ ubuntu-latest, macos-latest ] | ||
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.x' ] | ||
exclude: | ||
- os: macos-latest | ||
python-version: '3.x' | ||
steps: | ||
- name: clone repository | ||
uses: actions/checkout@v2 | ||
|
@@ -39,18 +60,33 @@ jobs: | |
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.*') }} | ||
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: pip install ".[testing]" | ||
- name: run tests | ||
if: matrix.python-version != '3.x' || matrix.os != 'ubuntu-latest' | ||
run: pytest --numprocesses auto | ||
test_with_coverage: | ||
needs: [ lint, test ] | ||
name: test with coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: clone repository | ||
uses: actions/checkout@v2 | ||
- name: install Python | ||
uses: actions/setup-python@v2 | ||
- name: load cached Python installation | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: install dependencies | ||
run: pip install ".[testing]" | ||
- name: run tests with coverage | ||
if: matrix.python-version == '3.x' && matrix.os == 'ubuntu-latest' | ||
run: pytest --numprocesses auto --cov . --cov-report xml:coverage.xml | ||
- name: show coverage report | ||
run: coverage report | ||
- name: upload coverage to Codecov | ||
if: matrix.python-version == '3.x' && matrix.os == 'ubuntu-latest' | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
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,54 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
paths: | ||
- '**.py' | ||
- '.github/workflows/tests_simple.yml' | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: clone repository | ||
uses: actions/checkout@v2 | ||
- name: install Python | ||
uses: actions/setup-python@v2 | ||
- name: load cached Python installation | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: install linters | ||
run: pip install flake8 oitnb | ||
- name: lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: lint with oitnb | ||
run: oitnb . --check | ||
test: | ||
needs: lint | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: clone repository | ||
uses: actions/checkout@v2 | ||
- name: install Python | ||
uses: actions/setup-python@v2 | ||
- name: load cached Python installation | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} | ||
- name: install dependencies | ||
run: pip install ".[testing]" | ||
- name: run tests | ||
run: pytest --numprocesses auto |
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,6 +1,47 @@ | ||
[tool.poetry] | ||
name = 'stormevents' | ||
version = '0.0.0' | ||
description = 'Python interfaces for observational data surrounding named storm events' | ||
authors = ['Zach Burnett <[email protected]>'] | ||
license = 'GPL-3.0-or-later' | ||
readme = 'README.md' | ||
repository = 'https://github.com/oceanmodeling/StormEvents.git' | ||
documentation = 'https://stormevents.readthedocs.io' | ||
|
||
[build-system] | ||
requires = [ | ||
"dunamai", | ||
"setuptools", | ||
'poetry-core>=1.0.0', | ||
'poetry-dynamic-versioning', | ||
] | ||
build-backend = "setuptools.build_meta" | ||
build-backend = 'poetry.core.masonry.api' | ||
|
||
[tool.poetry-dynamic-versioning] | ||
enable = true | ||
|
||
[tool.poetry.dependencies] | ||
python = '^3.6' | ||
beautifulsoup4 = '*' | ||
geopandas = '*' | ||
netcdf4 = '*' | ||
numpy = '*' | ||
python-dateutil = '*' | ||
pandas = '*' | ||
pyproj = '>=2.6' | ||
requests = '*' | ||
shapely = '*' | ||
typepigeon = '>=1.0.5' | ||
xarray = '*' | ||
isort = { version = '*', optional = true } | ||
oitnb = { version = '*', optional = true } | ||
pytest = { version = '*', optional = true } | ||
pytest-cov = { version = '*', optional = true } | ||
pytest-socket = { version = '*', optional = true } | ||
pytest-xdist = { version = '*', optional = true } | ||
m2r2 = { version = '*', optional = true } | ||
sphinx = { version = '*', optional = true } | ||
sphinx-rtd-theme = { version = '*', optional = true } | ||
|
||
[tool.poetry.extras] | ||
testing = ['pytest', 'pytest-cov', 'pytest-socket', 'pytest-xdist'] | ||
development = ['isort', 'oitnb'] | ||
documentation = ['m2r2', 'sphinx', 'sphinx-rtd-theme'] |
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
Oops, something went wrong.