-
Notifications
You must be signed in to change notification settings - Fork 3
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
(#134)
* move configuration into `pyproject.toml` * update test workflows * update reference files * update test * rename tests * test fix * `fail-fast: true` * test fix
- Loading branch information
1 parent
b457b94
commit 379b111
Showing
83 changed files
with
1,165 additions
and
985 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: build-${{ 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: quick test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
paths: | ||
- '**.py' | ||
- '.github/workflows/quick_test.yml' | ||
- 'pyproject.toml' | ||
|
||
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: quick 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,44 +1,50 @@ | ||
name: tests | ||
|
||
on: [ push ] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.py' | ||
- '.github/workflows/tests.yml' | ||
- 'pyproject.toml' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.x' ] | ||
steps: | ||
- name: clone 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: install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: pip install ".[development]" | ||
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: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.7', '3.x' ] | ||
os: [ ubuntu-latest, macos-latest ] | ||
python-version: [ '3.7', '3.8', '3.9', '3.x' ] | ||
steps: | ||
- name: clone repository | ||
uses: actions/checkout@v2 | ||
|
@@ -51,18 +57,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 |
---|---|---|
@@ -1,6 +1,51 @@ | ||
[tool.poetry] | ||
name = 'coupledmodeldriver' | ||
version = '0.0.0' | ||
description = 'coupled model configuration generation' | ||
authors = ['Zach Burnett <[email protected]>'] | ||
license = 'CC0-1.0' | ||
readme = 'README.md' | ||
repository = 'https://github.com/noaa-ocs-modeling/CoupledModelDriver.git' | ||
documentation = 'https://coupledmodeldriver.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.7' | ||
adcircpy = '>=1.1.2' | ||
file-read-backwards = '*' | ||
nemspy = '>=1.0.4' | ||
numpy = '*' | ||
pyproj = '*' | ||
typepigeon = '>=1.0.3' | ||
isort = { version = '*', optional = true } | ||
oitnb = { version = '*', optional = true } | ||
pooch = { version = '*', optional = true } | ||
pytest = { version = '*', optional = true } | ||
pytest-cov = { version = '*', optional = true } | ||
pytest-socket = { version = '*', optional = true } | ||
pytest-xdist = { version = '*', optional = true } | ||
wget = { version = '*', optional = true } | ||
m2r2 = { version = '*', optional = true } | ||
sphinx = { version = '*', optional = true } | ||
sphinx-rtd-theme = { version = '*', optional = true } | ||
sphinxcontrib-programoutput = { version = '*', optional = true } | ||
|
||
[tool.poetry.extras] | ||
testing = ['pooch', 'pytest', 'pytest-cov', 'pytest-socket', 'pytest-xdist', 'wget'] | ||
development = ['isort', 'oitnb'] | ||
documentation = ['m2r2', 'sphinx', 'sphinx-rtd-theme', 'sphinxcontrib-programoutput'] | ||
|
||
[tool.poetry.scripts] | ||
initialize_adcirc = 'coupledmodeldriver.client.initialize_adcirc:main' | ||
generate_adcirc = 'coupledmodeldriver.client.generate_adcirc:main' | ||
check_completion = 'coupledmodeldriver.client.check_completion:main' | ||
unqueued_runs = 'coupledmodeldriver.client.unqueued_runs:main' |
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
2 changes: 1 addition & 1 deletion
2
tests/data/reference/test_hera_adcirc_nems_atmesh_ww3data/runs/unperturbed/config.rc
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
2 changes: 1 addition & 1 deletion
2
tests/data/reference/test_hera_adcirc_nems_atmesh_ww3data/runs/unperturbed/fort.15
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
2 changes: 1 addition & 1 deletion
2
tests/data/reference/test_hera_adcirc_nems_atmesh_ww3data/runs/unperturbed/model_configure
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
2 changes: 1 addition & 1 deletion
2
tests/data/reference/test_hera_adcirc_nems_atmesh_ww3data/runs/unperturbed/nems.configure
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
2 changes: 1 addition & 1 deletion
2
tests/data/reference/test_hera_adcirc_tidal/runs/unperturbed/fort.15
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
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
2 changes: 1 addition & 1 deletion
2
...s/data/reference/test_hera_adcirc_tidal_besttrack_nems_ww3data/runs/unperturbed/config.rc
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,3 +1,3 @@ | ||
# `config.rc` generated with NEMSpy 1.0.5 | ||
# `config.rc` generated with NEMSpy 1.0.8 | ||
wav_dir: ../../../../input/forcings/ike | ||
wav_nam: ww3.Constant.20151214_sxy_ike_date.nc |
2 changes: 1 addition & 1 deletion
2
tests/data/reference/test_hera_adcirc_tidal_besttrack_nems_ww3data/runs/unperturbed/fort.15
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.