diff --git a/.cruft.json b/.cruft.json index 2ce633b..47a3a96 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/Ouranosinc/cookiecutter-pypackage", - "commit": "3d54a051d7983ce273c4e88e9c88cf5b8ca5754b", + "commit": "5a2bb58673b5901c51a5b8e242971bfaf9151c5c", "checkout": null, "context": { "cookiecutter": { @@ -22,7 +22,7 @@ "create_author_file": "y", "open_source_license": "Apache Software License 2.0", "generated_with_cruft": "y", - "__gh_slug": "hydrologie/xhydro_lstm", + "__gh_slug": "https://github.com/hydrologie/xhydro-lstm", "_template": "https://github.com/Ouranosinc/cookiecutter-pypackage" } }, diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a9f2875..d86e88c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,13 +3,11 @@ updates: - package-ecosystem: github-actions directory: / 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 diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 0c9df03..cc05678 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -43,7 +43,7 @@ jobs: contents: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block @@ -51,10 +51,10 @@ jobs: files.pythonhosted.org:443 github.com:443 pypi.org:443 - - uses: actions/checkout@v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: persist-credentials: false - - uses: actions/setup-python@v4 + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: "3.x" - name: Config Commit Bot diff --git a/.github/workflows/cache-cleaner.yml b/.github/workflows/cache-cleaner.yml index d48a7f6..6d206e3 100644 --- a/.github/workflows/cache-cleaner.yml +++ b/.github/workflows/cache-cleaner.yml @@ -16,7 +16,7 @@ jobs: actions: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index c977388..7936db5 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block @@ -25,7 +25,7 @@ jobs: github.com:443 - name: 'Checkout Repository' - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: 'Dependency Review' - uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 + uses: actions/dependency-review-action@0c155c5e8556a497adf53f2c18edabf945ed8e70 # v4.3.2 diff --git a/.github/workflows/first-pull-request.yml b/.github/workflows/first-pull-request.yml index dfaca22..f8ed968 100644 --- a/.github/workflows/first-pull-request.yml +++ b/.github/workflows/first-pull-request.yml @@ -11,14 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > api.github.com:443 - - uses: actions/github-script@v6 + - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | // Get a list of all issues created by the PR opener diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 00036d9..1c048a6 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -25,13 +25,13 @@ jobs: pull-requests: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > api.github.com:443 - - uses: actions/labeler@v5.0.0 + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7219136..babdeb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,9 +30,9 @@ jobs: python-version: - "3.x" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Python${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: ${{ matrix.python-version }} - name: Install tox @@ -60,9 +60,13 @@ jobs: - tox-env: "py312" python-version: "3.12" steps: - - uses: actions/checkout@v4 + - name: Harden Runner + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + with: + egress-policy: audit + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Python${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: ${{ matrix.python-version }} - name: Install tox @@ -89,12 +93,12 @@ jobs: shell: bash -l {0} steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: egress-policy: audit - - uses: actions/checkout@v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - 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 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index f91b018..c98d19e 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -18,7 +18,7 @@ jobs: id-token: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block @@ -27,9 +27,9 @@ jobs: github.com:443 pypi.org:443 upload.pypi.org:443 - - uses: actions/checkout@v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Python3 - uses: actions/setup-python@v4 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: "3.x" - name: Install packaging libraries diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index cb4f4ba..7372d80 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -13,7 +13,7 @@ on: - cron: '41 8 * * 4' push: branches: - - master + - main # Declare default permissions as read only. permissions: read-all @@ -36,20 +36,22 @@ jobs: allowed-endpoints: > api.github.com:443 api.osv.dev:443 + api.scorecard.dev:443 api.securityscorecards.dev:443 fulcio.sigstore.dev:443 github.com:443 + index.docker.io:443 oss-fuzz-build-logs.storage.googleapis.com:443 rekor.sigstore.dev:443 tuf-repo-cdn.sigstore.dev:443 www.bestpractices.dev:443 - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: persist-credentials: false - name: Run analysis - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 + uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 with: results_file: results.sarif results_format: sarif @@ -69,7 +71,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: Upload artifact - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: SARIF file path: results.sarif @@ -77,6 +79,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@e5f05b81d5b6ff8cfa111c80c22c5fd02a384118 # 3.23.0 + uses: github/codeql-action/upload-sarif@b7cec7526559c32f1616476ff32d17ba4c59b2d6 # 3.25.5 with: sarif_file: results.sarif diff --git a/.github/workflows/tag-testpypi.yml b/.github/workflows/tag-testpypi.yml index 13487a3..d5bad44 100644 --- a/.github/workflows/tag-testpypi.yml +++ b/.github/workflows/tag-testpypi.yml @@ -17,13 +17,13 @@ jobs: contents: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: egress-policy: audit - name: Checkout code uses: actions/checkout@v4 - name: Create Release - uses: softprops/action-gh-release@v1 + 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 }} @@ -42,7 +42,7 @@ jobs: id-token: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block @@ -51,9 +51,9 @@ jobs: github.com:443 pypi.org:443 test.pypi.org:443 - - uses: actions/checkout@v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Set up Python3 - uses: actions/setup-python@v4 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 with: python-version: "3.x" - name: Install packaging libraries diff --git a/.github/workflows/workflow-warning.yml b/.github/workflows/workflow-warning.yml index 433881b..a4887a7 100644 --- a/.github/workflows/workflow-warning.yml +++ b/.github/workflows/workflow-warning.yml @@ -26,14 +26,14 @@ jobs: pull-requests: write steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > api.github.com:443 - name: Find comment - uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2.4.0 + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0 id: fc with: issue-number: ${{ github.event.pull_request.number }} @@ -45,7 +45,7 @@ jobs: (steps.fc.outputs.comment-id == '') && (!contains(github.event.pull_request.labels.*.name, 'approved')) && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) - uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3.1.0 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} @@ -57,7 +57,7 @@ jobs: - name: Update comment if: | contains(github.event.pull_request.labels.*.name, 'approved') - uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3.1.0 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92367f3..2575238 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: rev: v0.3.9 hooks: - id: blackdoc - additional_dependencies: [ 'black==24.2.0' ] + additional_dependencies: [ 'black==24.4.2' ] - repo: https://github.com/adrienverge/yamllint.git rev: v1.35.1 hooks: @@ -79,6 +79,6 @@ ci: autofix_prs: true autoupdate_branch: '' autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' - autoupdate_schedule: weekly + autoupdate_schedule: monthly skip: [] submodules: false diff --git a/.readthedocs.yml b/.readthedocs.yml index 54eb849..c1601ea 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -16,7 +16,7 @@ build: python: "mambaforge-22.9" jobs: pre_build: - - sphinx-apidoc -o docs/apidoc --private --module-first xhydro_lstm + - sphinx-apidoc -o docs/apidoc --private --module-first src/xhydro_lstm - sphinx-build -M gettext docs docs/_build conda: diff --git a/.zenodo.json b/.zenodo.json index 5faae65..ce6f0e9 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -2,7 +2,19 @@ "title": "xhydro-lstm", "creators": [ { - "name": "Arsenault, Richard" + "name": "Arsenault, Richard", + "affiliation": "École de technologie supérieure, Montréal, Québec, Canada", + "orcid": "0000-0003-2834-2750" + }, + { + "name": "Smith, Trevor James", + "affiliation": "Ouranos, Montréal, Québec, Canada", + "orcid": "0000-0001-5393-8359" + }, + { + "name": "Rondeau-Genesse, Gabriel", + "affiliation": "Ouranos, Montréal, Québec, Canada", + "orcid": "0000-0003-3389-9406" } ], "keywords": [ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index de0df8d..335495e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,8 +20,9 @@ Fixes `v0.1.0 `_ ---------------------------------------------------------------- -Contributors: Richard Arsenault `hydrologie `_ +Contributors: Trevor James Smith (:user:`Zeitsperre`) Changes ^^^^^^^ +* Generated the first version of the package using the cookiecutter template (`Ouranosinc/cookiecutter-pypackage `_). (:issue:`1`, :pull:`13`) * First release on PyPI. diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst index d11c563..ebc9f02 100644 --- a/CODE_OF_CONDUCT.rst +++ b/CODE_OF_CONDUCT.rst @@ -5,80 +5,135 @@ Contributor Covenant Code of Conduct Our Pledge ---------- -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to make participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. Our Standards ------------- -Examples of behavior that contributes to creating a positive environment -include: +Examples of behavior that contributes to a positive environment for our +community include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community -Examples of unacceptable behavior by participants include: +Examples of unacceptable behavior include: -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission +* Publishing others' private information, such as a physical or email address, + without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting -Our Responsibilities --------------------- +Enforcement Responsibilities +---------------------------- -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. Scope ----- -This Code of Conduct applies within all project spaces, and it also applies when -an individual is representing the project or its community in public spaces. -Examples of representing a project or community include using an official -project e-mail address, posting via an official social media account, or acting -as an appointed representative at an online or offline event. Representation of -a project may be further defined and clarified by project maintainers. +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. Enforcement ----------- Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [INSERT EMAIL ADDRESS]. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +Enforcement Guidelines +---------------------- + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +1. Correction +^^^^^^^^^^^^^ + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +2. Warning +^^^^^^^^^^ + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +3. Temporary Ban +^^^^^^^^^^^^^^^^ + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +4. Permanent Ban +^^^^^^^^^^^^^^^^ + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +**Consequence**: A permanent ban from any sort of public interaction within the +community. Attribution ----------- -This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +This Code of Conduct is adapted from the `Contributor Covenant homepage `_, +version 2.1, available at +``_. -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +Community Impact Guidelines were inspired by +`Mozilla's code of conduct enforcement ladder `_. -.. _`Contributor Covenant`: https://www.contributor-covenant.org +For answers to common questions about this code of conduct, see the FAQ at +``_. Translations are available at +``_. diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f38021c..ad45f5d 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -12,7 +12,7 @@ Types of Contributions Report Bugs ~~~~~~~~~~~ -Report bugs at https://github.com/hydrologie/xhydro_lstm/issues. +Report bugs at https://github.com/hydrologie/xhydro-lstm/issues. If you are reporting a bug, please include: @@ -38,7 +38,7 @@ xhydro-lstm could always use more documentation, whether as part of the official Submit Feedback ~~~~~~~~~~~~~~~ -The best way to send feedback is to file an issue at https://github.com/hydrologie/xhydro_lstm/issues. +The best way to send feedback is to file an issue at https://github.com/hydrologie/xhydro-lstm/issues. If you are proposing a feature: @@ -56,9 +56,9 @@ Get Started! .. warning:: - Anaconda Python users: Due to the complexity of some packages, the default dependency solver can take a long time to resolve the environment. Consider running the following commands in order to speed up the process:: + Anaconda Python users: Due to the complexity of some packages, the default dependency solver can take a long time to resolve the environment. Consider running the following commands in order to speed up the process: - .. code-block:: console + .. code-block:: console conda install -n base conda-libmamba-solver conda config --set solver libmamba @@ -67,76 +67,75 @@ Get Started! Alternatively, you can use the `mamba `_ package manager, which is a drop-in replacement for ``conda``. If you are already using `mamba`, replace the following commands with ``mamba`` instead of ``conda``. -Ready to contribute? Here's how to set up ``xhydro_lstm`` for local development. +Ready to contribute? Here's how to set up ``xhydro-lstm`` for local development. -#. Fork the ``xhydro_lstm`` repo on GitHub. -#. Clone your fork locally:: +#. Fork the ``xhydro-lstm`` repo on GitHub. +#. Clone your fork locally: - .. code-block:: console + .. code-block:: console - git clone git@github.com:your_name_here/xhydro_lstm.git + git clone git@github.com:your_name_here/xhydro-lstm.git -#. Install your local copy into a development environment. You can create a new Anaconda development environment with:: +#. Install your local copy into a development environment. You can create a new Anaconda development environment with: - .. code-block:: console + .. code-block:: console - conda env create -f environment-dev.yml - conda activate xhydro_lstm - make dev + conda env create -f environment-dev.yml + conda activate xhydro_lstm + make dev - This installs ``xhydro_lstm`` in an "editable" state, meaning that changes to the code are immediately seen by the environment. - -#. To ensure a consistent coding style, ``make dev`` also installs the ``pre-commit`` hooks to your local clone:: + This installs ``xhydro_lstm`` in an "editable" state, meaning that changes to the code are immediately seen by the environment. To ensure a consistent coding style, ``make dev`` also installs the ``pre-commit`` hooks to your local clone. On commit, ``pre-commit`` will check that ``black``, ``blackdoc``, ``isort``, ``flake8``, and ``ruff`` checks are passing, perform automatic fixes if possible, and warn of violations that require intervention. If your commit fails the checks initially, simply fix the errors, re-add the files, and re-commit. - You can also run the hooks manually with:: + You can also run the hooks manually with: - .. code-block:: console + .. code-block:: console - pre-commit run -a + pre-commit run -a If you want to skip the ``pre-commit`` hooks temporarily, you can pass the ``--no-verify`` flag to `git commit`. -#. Create a branch for local development:: +#. Create a branch for local development: - .. code-block:: console + .. code-block:: console - git checkout -b name-of-your-bugfix-or-feature + git checkout -b name-of-your-bugfix-or-feature Now you can make your changes locally. -#. When you're done making changes, we **strongly** suggest running the tests in your environment or with the help of ``tox``:: +#. When you're done making changes, we **strongly** suggest running the tests in your environment or with the help of ``tox``: + + .. code-block:: console - .. code-block:: console - make lint - python -m pytest - # Or, to run multiple build tests - python -m tox + make lint + python -m pytest + # Or, to run multiple build tests + python -m tox -#. Commit your changes and push your branch to GitHub:: +#. Commit your changes and push your branch to GitHub: - .. code-block:: console + .. code-block:: console - git add . - git commit -m "Your detailed description of your changes." - git push origin name-of-your-bugfix-or-feature + git add . + git commit -m "Your detailed description of your changes." + git push origin name-of-your-bugfix-or-feature - If ``pre-commit`` hooks fail, try re-committing your changes (or, if need be, you can skip them with `git commit --no-verify`). + If ``pre-commit`` hooks fail, try re-committing your changes (or, if need be, you can skip them with `git commit --no-verify`). #. Submit a `Pull Request `_ through the GitHub website. -#. When pushing your changes to your branch on GitHub, the documentation will automatically be tested to reflect the changes in your Pull Request. This build process can take several minutes at times. If you are actively making changes that affect the documentation and wish to save time, you can compile and test your changes beforehand locally with:: +#. When pushing your changes to your branch on GitHub, the documentation will automatically be tested to reflect the changes in your Pull Request. This build process can take several minutes at times. If you are actively making changes that affect the documentation and wish to save time, you can compile and test your changes beforehand locally with: - .. code-block:: console + .. code-block:: console - # To generate the html and open it in your browser - make docs - # To only generate the html - make autodoc - make -C docs html - # To simply test that the docs pass build checks - python -m tox -e docs + # To generate the html and open it in your browser + make docs + # To only generate the html + make autodoc + make -C docs html + # To simply test that the docs pass build checks + python -m tox -e docs #. Once your Pull Request has been accepted and merged to the ``main`` branch, several automated workflows will be triggered: @@ -144,7 +143,7 @@ Ready to contribute? Here's how to set up ``xhydro_lstm`` for local development. - `ReadTheDocs` will automatically build the documentation and publish it to the `latest` branch of `xhydro_lstm` documentation website. - If your branch is not a fork (ie: you are a maintainer), your branch will be automatically deleted. - You will have contributed your first changes to ``xhydro_lstm``! + You will have contributed your first changes to ``xhydro_lstm``! Pull Request Guidelines ----------------------- @@ -160,15 +159,17 @@ Before you submit a pull request, check that it meets these guidelines: Tips ---- -To run a subset of tests:: +To run a subset of tests: + +.. code-block:: console - .. code-block:: console -pytest tests.test_xhydro_lstm + python -m pytest tests.test_xhydro_lstm -To run specific code style checks:: - .. code-block:: console +To run specific code style checks: + +.. code-block:: console python -m black --check xhydro_lstm tests python -m isort --check xhydro_lstm tests @@ -181,7 +182,5 @@ To get ``black``, ``isort``, ``blackdoc``, ``ruff``, and ``flake8`` (with plugin Code of Conduct --------------- -Please note that this project is released with a `Contributor Code of Conduct`_. +Please note that this project is released with a `Contributor Code of Conduct `_. By participating in this project you agree to abide by its terms. - -.. _`Contributor Code of Conduct`: CODE_OF_CONDUCT.rst diff --git a/Makefile b/Makefile index 02d8397..bd2e7ee 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ initialize-translations: clean-docs ## initialize translations, ignoring autodoc sphinx-intl update -p docs/_build/gettext -d docs/locales -l fr autodoc: clean-docs ## create sphinx-apidoc files: - sphinx-apidoc -o docs/apidoc --private --module-first xhydro_lstm + sphinx-apidoc -o docs/apidoc --private --module-first src/xhydro_lstm linkcheck: autodoc ## run checks over all external links found throughout the documentation $(MAKE) -C docs linkcheck diff --git a/README.rst b/README.rst index fda92f1..b050783 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ xhydro-lstm | Development Status | |status| |build| |coveralls| | +----------------------------+-----------------------------------------------------+ -Python Boilerplate contains all the boilerplate you need to create a Python package. +Hydrological modelling using LSTMs * Free software: Apache Software License 2.0 * Documentation: https://xhydro-lstm.readthedocs.io. @@ -37,32 +37,32 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp :target: https://github.com/psf/black :alt: Python Black -.. |build| image:: https://github.com/hydrologie/xhydro_lstm/actions/workflows/main.yml/badge.svg - :target: https://github.com/hydrologie/xhydro_lstm/actions +.. |build| image:: https://github.com/hydrologie/xhydro-lstm/actions/workflows/main.yml/badge.svg + :target: https://github.com/hydrologie/xhydro-lstm/actions :alt: Build Status -.. |coveralls| image:: https://coveralls.io/repos/github/hydrologie/xhydro_lstm/badge.svg - :target: https://coveralls.io/github/hydrologie/xhydro_lstm +.. |coveralls| image:: https://coveralls.io/repos/github/hydrologie/xhydro-lstm/badge.svg + :target: https://coveralls.io/github/hydrologie/xhydro-lstm :alt: Coveralls .. |docs| image:: https://readthedocs.org/projects/xhydro-lstm/badge/?version=latest :target: https://xhydro-lstm.readthedocs.io/en/latest/?version=latest :alt: Documentation Status -.. |license| image:: https://img.shields.io/github/license/hydrologie/xhydro_lstm.svg - :target: https://github.com/hydrologie/xhydro_lstm/blob/main/LICENSE +.. |license| image:: https://img.shields.io/github/license/hydrologie/xhydro-lstm.svg + :target: https://github.com/hydrologie/xhydro-lstm/blob/main/LICENSE :alt: License -.. |ossf| image:: https://api.securityscorecards.dev/projects/github.com/hydrologie/xhydro_lstm/badge - :target: https://securityscorecards.dev/viewer/?uri=github.com/hydrologie/xhydro_lstm +.. |ossf| image:: https://api.securityscorecards.dev/projects/github.com/hydrologie/xhydro-lstm/badge + :target: https://securityscorecards.dev/viewer/?uri=github.com/hydrologie/xhydro-lstm :alt: OpenSSF Scorecard -.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/hydrologie/xhydro_lstm/main.svg - :target: https://results.pre-commit.ci/latest/github/hydrologie/xhydro_lstm/main +.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/hydrologie/xhydro-lstm/main.svg + :target: https://results.pre-commit.ci/latest/github/hydrologie/xhydro-lstm/main :alt: pre-commit.ci status -.. |pypi| image:: https://img.shields.io/pypi/v/xhydro_lstm.svg - :target: https://pypi.python.org/pypi/xhydro_lstm +.. |pypi| image:: https://img.shields.io/pypi/v/xhydro-lstm.svg + :target: https://pypi.python.org/pypi/xhydro-lstm :alt: PyPI .. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json @@ -73,6 +73,6 @@ This package was created with Cookiecutter_ and the `Ouranosinc/cookiecutter-pyp :target: https://www.repostatus.org/#active :alt: Project Status: Active – The project has reached a stable, usable state and is being actively developed. -.. |versions| image:: https://img.shields.io/pypi/pyversions/xhydro_lstm.svg - :target: https://pypi.python.org/pypi/xhydro_lstm +.. |versions| image:: https://img.shields.io/pypi/pyversions/xhydro-lstm.svg + :target: https://pypi.python.org/pypi/xhydro-lstm :alt: Supported Python Versions diff --git a/docs/conf.py b/docs/conf.py index 001b801..998e997 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,8 +53,8 @@ } extlinks = { - "issue": ("https://github.com/hydrologie/xhydro_lstm/issues/%s", "GH/%s"), - "pull": ("https://github.com/hydrologie/xhydro_lstm/pull/%s", "PR/%s"), + "issue": ("https://github.com/hydrologie/xhydro-lstm/issues/%s", "GH/%s"), + "pull": ("https://github.com/hydrologie/xhydro-lstm/pull/%s", "PR/%s"), "user": ("https://github.com/%s", "@%s"), } diff --git a/docs/installation.rst b/docs/installation.rst index 7a99d69..9142068 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -2,7 +2,6 @@ Installation ============ - Stable release -------------- @@ -10,12 +9,11 @@ To install xhydro-lstm, run this command in your terminal: .. code-block:: console - $ python -m pip install xhydro_lstm + python -m pip install xhydro_lstm This is the preferred method to install xhydro-lstm, as it will always install the most recent stable release. -If you don't have `pip`_ installed, this `Python installation guide`_ can guide -you through the process. +If you don't have `pip`_ installed, this `Python installation guide`_ can guide you through the process. .. _pip: https://pip.pypa.io .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ @@ -24,26 +22,22 @@ you through the process. From sources ------------ -The sources for xhydro-lstm can be downloaded from the `Github repo`_. +The sources for xhydro-lstm can be downloaded from the `Github repo `_. You can either clone the public repository: .. code-block:: console - $ git clone git@github.com:hydrologie/xhydro_lstm + git clone git@github.com:hydrologie/xhydro-lstm.git -Or download the `tarball`_: +Or download the `tarball `_: .. code-block:: console - $ curl -OJL https://github.com/hydrologie/xhydro_lstm/tarball/main + curl -OJL https://github.com/hydrologie/xhydro-lstm/tarball/main Once you have a copy of the source, you can install it with: .. code-block:: console - $ python -m pip install . - - -.. _Github repo: https://github.com/hydrologie/xhydro_lstm -.. _tarball: https://github.com/hydrologie/xhydro_lstm/tarball/main + python -m pip install . diff --git a/docs/releasing.rst b/docs/releasing.rst index 3e3e9ff..7bf7016 100644 --- a/docs/releasing.rst +++ b/docs/releasing.rst @@ -9,24 +9,25 @@ A reminder for the **maintainers** on how to deploy. This section is only releva .. warning:: - It is important to be aware that any changes to files found within the ``xhydro_lstm`` folder (with the exception of ``xhydro_lstm/__init__.py``) will trigger the ``bump-version.yml`` workflow. Be careful not to commit changes to files in this folder when preparing a new release. + It is important to be aware that any changes to files found within the ``src/xhydro_lstm`` folder (with the exception of ``src/xhydro_lstm/__init__.py``) will trigger the ``bump-version.yml`` workflow. Be careful not to commit changes to files in this folder when preparing a new release. #. Create a new branch from `main` (e.g. `release-0.2.0`). #. Update the `CHANGELOG.rst` file to change the `Unreleased` section to the current date. -#. Bump the version in your branch to the next version (e.g. `v0.1.0 -> v0.2.0`):: +#. Bump the version in your branch to the next version (e.g. `v0.1.0 -> v0.2.0`): - .. code-block:: console + .. code-block:: console - bump-my-version bump minor # In most cases, we will be releasing a minor version - git push + bump-my-version bump minor # In most cases, we will be releasing a minor version + bump-my-version bump release # This will update the version strings to drop the `dev` suffix + git push #. Create a pull request from your branch to `main`. -#. Once the pull request is merged, create a new release on GitHub. On the main branch, run:: +#. Once the pull request is merged, create a new release on GitHub. On the `main` branch, run: - .. code-block:: console + .. code-block:: console - git tag v0.2.0 - git push --tags + git tag v0.2.0 + git push --tags This will trigger a GitHub workflow to build the package and upload it to TestPyPI. At the same time, the GitHub workflow will create a draft release on GitHub. Assuming that the workflow passes, the final release can then be published on GitHub by finalizing the draft release. @@ -34,7 +35,7 @@ A reminder for the **maintainers** on how to deploy. This section is only releva .. warning:: - Uploads to PyPI can **never** be overwritten. If you make a mistake, you will need to bump the version and re-release the package. If the package uploaded to PyPI is broken, you should modify the GitHub release to mark the package as broken, as well as yank the package (mark the version "broken") on PyPI. + Uploads to PyPI can **never** be overwritten. If you make a mistake, you will need to bump the version and re-release the package. If the package uploaded to PyPI is broken, you should modify the GitHub release to mark the package as broken, as well as yank the package (mark the version "broken") on PyPI. Packaging --------- @@ -44,23 +45,23 @@ When a new version has been minted (features have been successfully integrated t The simple approach ~~~~~~~~~~~~~~~~~~~ -The simplest approach to packaging for general support (pip wheels) requires that ``flit`` be installed:: +The simplest approach to packaging for general support (pip wheels) requires that `flit` be installed: - .. code-block:: console + .. code-block:: console - python -m pip install flit + python -m pip install flit -From the command line on your Linux distribution, simply run the following from the clone's main dev branch:: +From the command line on your Linux distribution, simply run the following from the clone's main dev branch: - .. code-block:: console + .. code-block:: console - # To build the packages (sources and wheel) - make dist + # To build the packages (sources and wheel) + make dist - # To upload to PyPI - make release + # To upload to PyPI + make release -The new version based off of the version checked out will now be available via `pip` (`pip install xhydro_lstm`). +The new version based off of the version checked out will now be available via `pip` (`pip install xhydro-lstm`). Releasing on conda-forge ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -72,18 +73,18 @@ Before preparing an initial release on conda-forge, we *strongly* suggest consul * https://conda-forge.org/docs/maintainer/adding_pkgs.html * https://github.com/conda-forge/staged-recipes -In order to create a new conda build recipe, to be used when proposing packages to the conda-forge repository, we strongly suggest using the ``grayskull`` tool:: +In order to create a new conda build recipe, to be used when proposing packages to the conda-forge repository, we strongly suggest using the `grayskull` tool: .. code-block:: console - python -m pip install grayskull - grayskull pypi xhydro_lstm + python -m pip install grayskull + grayskull pypi xhydro-lstm -For more information on ``grayskull``, please see the following link: https://github.com/conda/grayskull +For more information on `grayskull`, please see the following link: https://github.com/conda/grayskull Before updating the main conda-forge recipe, we echo the conda-forge documentation and *strongly* suggest performing the following checks: * Ensure that dependencies and dependency versions correspond with those of the tagged version, with open or pinned versions for the `host` requirements. - * If possible, configure tests within the conda-forge build CI (e.g. `imports: xhydro_lstm`, `commands: pytest xhydro_lstm`). + * If possible, configure tests within the conda-forge build CI (e.g. `imports: xhydro_lstm`, `commands: pytest xhydro-lstm`). Subsequent releases ^^^^^^^^^^^^^^^^^^^ @@ -97,30 +98,29 @@ Building sources for wide support with `manylinux` image This section is for building source files that link to or provide links to C/C++ dependencies. It is not necessary to perform the following when building pure Python packages. -In order to do ensure best compatibility across architectures, we suggest building wheels using the `PyPA`'s `manylinux` -docker images (at time of writing, we endorse using `manylinux_2_24_x86_64`). +In order to do ensure best compatibility across architectures, we suggest building wheels using the `PyPA`'s `manylinux` docker images (at time of writing, we endorse using `manylinux_2_24_x86_64`). -With `docker` installed and running, begin by pulling the image:: +With `docker` installed and running, begin by pulling the image: - .. code-block:: console + .. code-block:: console - sudo docker pull quay.io/pypa/manylinux_2_24_x86_64 + sudo docker pull quay.io/pypa/manylinux_2_24_x86_64 -From the xhydro_lstm source folder we can enter into the docker container, providing access to the `xhydro_lstm` source files by linking them to the running image:: +From the xhydro-lstm source folder we can enter into the docker container, providing access to the `src/xhydro_lstm` source files by linking them to the running image: - .. code-block:: console + .. code-block:: console - sudo docker run --rm -ti -v $(pwd):/xhydro_lstm -w /xhydro_lstm quay.io/pypa/manylinux_2_24_x86_64 bash + sudo docker run --rm -ti -v $(pwd):/src/xhydro_lstm -w /src/xhydro_lstm quay.io/pypa/manylinux_2_24_x86_64 bash -Finally, to build the wheel, we run it against the provided Python3.9 binary:: +Finally, to build the wheel, we run it against the provided Python3.9 binary: - .. code-block:: console + .. code-block:: console - /opt/python/cp39-cp39m/bin/python -m build --sdist --wheel + /opt/python/cp39-cp39m/bin/python -m build --sdist --wheel -This will then place two files in `xhydro_lstm/dist/` ("xhydro_lstm-1.2.3-py3-none-any.whl" and "xhydro_lstm-1.2.3.tar.gz"). -We can now leave our docker container (`exit`) and continue with uploading the files to PyPI:: +This will then place two files in `xhydro-lstm/dist/` ("xhydro_lstm-1.2.3-py3-none-any.whl" and "xhydro-lstm-1.2.3.tar.gz"). +We can now leave our docker container (`exit`) and continue with uploading the files to PyPI: - .. code-block:: console + .. code-block:: console - python -m twine upload dist/* + python -m twine upload dist/* diff --git a/environment-dev.yml b/environment-dev.yml index 2f61a5b..a50be49 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -2,9 +2,9 @@ name: xhydro_lstm channels: - conda-forge dependencies: - - python >=3.9,<3.12 + - python >=3.9,<3.13 # Dev tools and testing - - pip >=23.1.2 + - pip >=23.3.0 - bump-my-version >=0.18.3 - watchdog >=3.0.0 - flake8 >=6.1.0 diff --git a/environment-docs.yml b/environment-docs.yml index a329620..e3a75b2 100644 --- a/environment-docs.yml +++ b/environment-docs.yml @@ -3,6 +3,7 @@ channels: - conda-forge - defaults dependencies: + - python >=3.12,<3.13 - sphinx - pandoc - sphinx-rtd-theme >=1.0 diff --git a/pyproject.toml b/pyproject.toml index fa56f5c..9c9a5de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [build-system] -requires = ["flit_core >=3.8,<4"] +requires = ["flit_core >=3.9,<4"] build-backend = "flit_core.buildapi" [project] -name = "xhydro_lstm" +name = "xhydro-lstm" authors = [ {name = "Richard Arsenault", email = "Richard.Arsenault@etsmtl.ca"} ] @@ -14,7 +14,7 @@ maintainers = [ ] readme = {file = "README.rst", content-type = "text/x-rst"} requires-python = ">=3.8.0" -keywords = ["xhydro_lstm"] +keywords = ["xhydro-lstm"] license = {file = "LICENSE"} classifiers = [ "Development Status :: 2 - Pre-Alpha", @@ -37,7 +37,7 @@ dependencies = [] [project.optional-dependencies] dev = [ # Dev tools and testing - "pip >=23.1.2", + "pip >=23.3.0", "bump-my-version >=0.18.3", "watchdog >=3.0.0", "flake8 >=6.1.0", @@ -50,7 +50,7 @@ dev = [ "mypy", "pytest >=7.3.1", "pytest-cov >=4.0.0", - "black ==24.2.0", + "black ==24.4.2", "blackdoc ==0.3.9", "isort ==5.13.2", "ruff >=0.3.0", @@ -69,7 +69,7 @@ docs = [ "ipykernel", "jupyter_client" ] -all = ["xhydro_lstm[dev]", "xhydro_lstm[docs]"] +all = ["xhydro-lstm[dev]", "xhydro-lstm[docs]"] [project.urls] # "Homepage" = "https://xhydro_lstm.readthedocs.io/" @@ -151,9 +151,9 @@ include = [ "docs/Makefile", "docs/conf.py", "docs/make.bat", + "src/xhydro_lstm", "tests/*.py", - "tox.ini", - "xhydro_lstm" + "tox.ini" ] exclude = [ "*.py[co]", diff --git a/tox.ini b/tox.ini index bb0f444..ad6550c 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = docs coveralls requires = - flit + flit >= 3.9.0 pip >= 23.3.0 opts = --verbose @@ -14,11 +14,11 @@ opts = [testenv:lint] skip_install = True deps = - black ==24.2.0 + black ==24.4.2 blackdoc ==0.3.9 isort ==5.13.2 flake8 - ruff >=0.2.0 + ruff >=0.3.0 commands = make lint allowlist_externals =