-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from Ocean-Data-Lab/repackage
Clean packaging and migrate to hatch
- Loading branch information
Showing
31 changed files
with
205 additions
and
237 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,3 @@ | ||
[flake8] | ||
max-line-length=100 | ||
extend-ignore = E203 |
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,56 +1,33 @@ | ||
name: unit test | ||
name: Unit Tests | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
CONDA_ENV: ooi | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
unit_test: | ||
name: ${{ matrix.python-version }}-unit-test | ||
runs-on: ubuntu-20.04 | ||
continue-on-error: ${{ matrix.experimental }} | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9', '3.10'] | ||
experimental: [false] | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
name: Check Python ${{ matrix.python-version }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Setup micromamba | ||
uses: mamba-org/provision-with-micromamba@v15 | ||
with: | ||
environment-file: conda_envs/py${{ matrix.python-version }}.yml | ||
environment-name: ${{ env.CONDA_ENV }} | ||
cache-env: true | ||
cache-env-key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(format('conda_envs/py{0}.yml', matrix.python-version)) }} | ||
- name: Print conda env | ||
shell: bash -l {0} | ||
run: | | ||
conda info | ||
conda list | ||
- name: Install pytest | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install pytest | ||
- name: Install ooipy | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install -e . | ||
- name: Run unit tests | ||
shell: bash -l {0} | ||
env: | ||
FORCE_COLOR: 3 | ||
run: pytest -vv tests |& tee unit_test_log${{ matrix.python-version }}.log | ||
- name: Upload unit test log | ||
if: ${{ success() || failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: unit_test_log${{ matrix.python-version }} | ||
path: unit_test_log${{ matrix.python-version }}.log | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Only needed if using setuptools-scm | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
|
||
- name: Install package | ||
run: python -m pip install -e .[test] | ||
|
||
- name: Test package | ||
run: python -m pytest -p no:warnings |
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ ooi_auth.txt | |
.eggs | ||
_ooipy_version.py | ||
*.nc | ||
src/ooipy/version.py | ||
|
||
# Environments | ||
.env | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,93 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 66", | ||
"setuptools_scm >= 7.0.0", | ||
"wheel >= 0.38.4", | ||
] | ||
build-backend = 'setuptools.build_meta' | ||
|
||
[tool.setuptools_scm] | ||
fallback_version = "unknown" | ||
local_scheme = "no-local-version" | ||
write_to = "_ooipy_version.py" | ||
write_to_template = 'version = "{version}"' | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "ooipy" | ||
dynamic = ["version"] | ||
description = 'toolbox for downloading and analyzing OOI hydrophone data' | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = "MIT" | ||
keywords = [] | ||
maintainers = [ | ||
{ name = "John Ragland", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
"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", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"fsspec", | ||
"xarray", | ||
"obspy", | ||
"pandas", | ||
"numpy", | ||
"tqdm", | ||
"aiohttp", | ||
] | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest >= 6.0", | ||
] | ||
dev = [ | ||
"pre-commit", | ||
"black" | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://ooipy.readthedocs.io" | ||
Issues = "https://github.com/Ocean-Data-Lab/ooipy/issues" | ||
Source = "https://github.com/Ocean-Data-Lab/ooipy" | ||
|
||
[tool.hatch] | ||
version.source = "vcs" | ||
build.hooks.vcs.version-file = "src/ooipy/version.py" | ||
|
||
|
||
[tool.hatch.envs.types] | ||
extra-dependencies = [ | ||
"mypy>=1.0.0", | ||
] | ||
[tool.hatch.envs.types.scripts] | ||
check = "mypy --install-types --non-interactive {args:src/ooipy tests}" | ||
|
||
[tool.coverage.run] | ||
source_pkgs = ["ooipy", "tests"] | ||
branch = true | ||
parallel = true | ||
omit = [ | ||
"src/ooipy/__about__.py", | ||
] | ||
|
||
[tool.coverage.paths] | ||
ooipy = ["src/ooipy", "*/ooipy/src/ooipy"] | ||
tests = ["tests", "*/ooipy/tests"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] | ||
xfail_strict = true | ||
filterwarnings = ["error"] | ||
log_cli_level = "info" | ||
testpaths = [ | ||
"tests", | ||
] | ||
|
||
[tool.black] | ||
line-length = 100 |
Oops, something went wrong.