-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update cookiecutter, restructure library (#126)
### What kind of change does this PR introduce? * Updates the cookiecutter to the latest commit. * The `ruff` linter has been adjusted to render the `flake8-alphabetize` dependency redundant (and removed). * Several `noqa` and `fixme` statements have been added to pass additional linting checks for now. ### Does this PR introduce a breaking change? Yes. * The structure of the package is slightly modified from a flat layout to a src layout. (https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/) * `CHANGES.rst` is now `CHANGELOG.rst`. (https://keepachangelog.com/en/1.1.0/#frequently-asked-questions) * Bumping a release version will trigger changes in the `CHANGELOG.rst` file. (Ouranosinc/cookiecutter-pypackage#41) ### Other information: ~This does not yet integrate changes from Ouranosinc/cookiecutter-pypackage#50 (but it should before merging)~ We should perform a release after this and then see about proposing the package to `conda-forge`!
- Loading branch information
Showing
43 changed files
with
771 additions
and
329 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage", | ||
"commit": "f391bbd6ee14ab2478c64a1f78b74bd9903cae81", | ||
"commit": "3b3598ae9524e7eb495bcba91093fac3369e753a", | ||
"checkout": null, | ||
"context": { | ||
"cookiecutter": { | ||
"full_name": "Sebastien Langlois", | ||
"email": "[email protected]", | ||
"github_username": "sebastienlanglois", | ||
"github_username": "hydrologie", | ||
"project_name": "xdatasets", | ||
"project_slug": "xdatasets", | ||
"project_short_description": "Easy access to Earth observation datasets with xarray.", | ||
|
@@ -22,6 +22,7 @@ | |
"create_author_file": "y", | ||
"open_source_license": "MIT license", | ||
"generated_with_cruft": "y", | ||
"__gh_slug": "https://github.com/hydrologie/xdatasets", | ||
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage" | ||
} | ||
}, | ||
|
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,9 +6,6 @@ exclude = | |
docs, | ||
tests | ||
ignore = | ||
AZ100, | ||
AZ200, | ||
AZ300, | ||
C, | ||
D, | ||
E, | ||
|
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,15 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
directory: /.github/workflows/ | ||
schedule: | ||
interval: daily | ||
time: '12:00' | ||
interval: monthly | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: pip | ||
directory: / | ||
schedule: | ||
interval: daily | ||
time: '12:00' | ||
interval: monthly | ||
open-pull-requests-limit: 10 |
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ on: | |
- .pre-commit-config.yaml | ||
- .yamllint.yaml | ||
- AUTHORS.rst | ||
- CHANGES.rst | ||
- CHANGELOG.rst | ||
- CONTRIBUTING.rst | ||
- docs/notebooks/**.ipynb | ||
- docs/*.py | ||
|
@@ -51,10 +51,13 @@ jobs: | |
files.pythonhosted.org:443 | ||
github.com:443 | ||
pypi.org:443 | ||
- uses: actions/[email protected] | ||
- name: Checkout Repository (no persist-credentials) | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/[email protected] | ||
fetch-depth: 0 | ||
- name: Set up Python3 | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.x" | ||
- name: Config Commit Bot | ||
|
@@ -68,7 +71,7 @@ jobs: | |
- name: Current Version | ||
run: | | ||
bump-my-version show current_version | ||
CURRENT_VERSION="$(grep -E '__version__' xdatasets/__init__.py | cut -d ' ' -f3)" | ||
CURRENT_VERSION="$(grep -E '__version__' src/xdatasets/__init__.py | cut -d ' ' -f3)" | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | ||
- name: Conditional Bump Version | ||
run: | | ||
|
@@ -81,7 +84,7 @@ jobs: | |
fi | ||
bump-my-version show-bump | ||
- name: Push Changes | ||
uses: ad-m/[email protected] | ||
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 | ||
with: | ||
force: false | ||
github_token: ${{ secrets.BUMP_VERSION_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 |
---|---|---|
|
@@ -25,7 +25,8 @@ jobs: | |
github.com:443 | ||
objects.githubusercontent.com:443 | ||
- uses: actions/[email protected] | ||
- name: Checkout Repository | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
|
||
- name: Cleanup | ||
run: | | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,8 @@ jobs: | |
allowed-endpoints: > | ||
api.github.com:443 | ||
- uses: actions/[email protected] | ||
- name: Verify Pull Request Opener | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
with: | ||
script: | | ||
// Get a list of all issues created by the PR opener | ||
|
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 |
---|---|---|
|
@@ -32,6 +32,7 @@ jobs: | |
allowed-endpoints: > | ||
api.github.com:443 | ||
- uses: actions/[email protected] | ||
- name: Label Pull Request | ||
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_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 |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- main | ||
paths-ignore: | ||
- .cruft.json | ||
- CHANGES.rst | ||
- CHANGELOG.rst | ||
- README.rst | ||
- pyproject.toml | ||
- tests/test_xdatasets.py | ||
|
@@ -30,9 +30,14 @@ jobs: | |
python-version: | ||
- "3.x" | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | ||
with: | ||
egress-policy: audit | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: Set up Python${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install tox | ||
|
@@ -62,7 +67,12 @@ jobs: | |
- tox-env: "py312" | ||
python-version: "3.12" | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
- name: Checkout Repository | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
- name: Install NetCDF | ||
run: | | ||
sudo apt-get -y update | ||
|
@@ -75,7 +85,7 @@ jobs: | |
cache: true | ||
version: ${{ env.ESMF_VERSION }} | ||
- name: Set up Python${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install tox | ||
|
@@ -102,9 +112,14 @@ jobs: | |
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }} | ||
uses: mamba-org/setup-micromamba@v1 | ||
uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7 # v1.8.1 | ||
with: | ||
cache-downloads: true | ||
environment-file: environment-dev.yml | ||
|
@@ -123,7 +138,7 @@ jobs: | |
- name: Test with pytest | ||
run: | | ||
python -m pytest --cov xdatasets | ||
- name: Report coverage | ||
- name: Report Coverage | ||
run: | | ||
python -m pip install coveralls | ||
python -m coveralls | ||
|
@@ -140,10 +155,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
- name: Coveralls Finished | ||
run: | | ||
python -m pip install --upgrade coveralls | ||
|
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 |
---|---|---|
|
@@ -27,9 +27,10 @@ jobs: | |
github.com:443 | ||
pypi.org:443 | ||
upload.pypi.org:443 | ||
- uses: actions/[email protected] | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: Set up Python3 | ||
uses: actions/[email protected] | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.x" | ||
- name: Install packaging libraries | ||
|
@@ -39,4 +40,4 @@ jobs: | |
run: | | ||
python -m flit build | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/[email protected] | ||
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0 |
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 |
---|---|---|
|
@@ -20,10 +20,10 @@ jobs: | |
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # 2.0.5 | ||
env: | ||
# This token is provided by Actions, you do not need to create your own token | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -51,9 +51,10 @@ jobs: | |
github.com:443 | ||
pypi.org:443 | ||
test.pypi.org:443 | ||
- uses: actions/[email protected] | ||
- name: Checkout Repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- name: Set up Python3 | ||
uses: actions/[email protected] | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.x" | ||
- name: Install packaging libraries | ||
|
@@ -63,7 +64,7 @@ jobs: | |
run: | | ||
python -m flit build | ||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/[email protected] | ||
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true |
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
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
Oops, something went wrong.