Skip to content

Commit

Permalink
use latest cookiecutter commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Nov 22, 2023
1 parent ac6daed commit 33bc8f9
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "31d78c6bc26d641561e498defe5d383b68d1afc8",
"commit": "e528361615f8bb4b886206b9cd49ffda76c45b45",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
30 changes: 30 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[flake8]
exclude =
.eggs,
.git,
build,
docs,
tests
ignore =
AZ100,
AZ200,
AZ300,
C,
D,
E,
F,
W503
per-file-ignores =
rst-roles =
doc,
mod,
py:attr,
py:attribute,
py:class,
py:const,
py:data,
py:func,
py:meth,
py:mod,
py:obj,
py:ref
4 changes: 2 additions & 2 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ jobs:
run: echo "current_version=$(grep -E '__version__' xdatasets/__init__.py | cut -d ' ' -f3)"
- name: Bump Patch Version
run: |
pip install bump2version
pip install bump-my-version
echo "Bumping version"
bump2version patch
bump-my-version bump patch
echo "new_version=$(grep -E '__version__' xdatasets/__init__.py | cut -d ' ' -f3)"
- name: Push Changes
uses: ad-m/github-push-action@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
# python -m pip check || true
# - name: Test with pytest
# run: |
# python -m pytest tests
# python -m pytest --cov xdatasets
# - name: Report coverage
# run: |
# python -m coveralls
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
release:
name: Create Release from tag
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '.0')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ repos:
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: setup.cfg
- id: end-of-file-fixer
- id: debug-statements
- id: check-json
Expand Down Expand Up @@ -46,7 +45,7 @@ repos:
hooks:
- id: flake8
additional_dependencies: [ 'flake8-alphabetize', 'flake8-rst-docstrings' ]
args: ['--config=setup.cfg']
args: ['--config=.flake8']
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
Expand Down
38 changes: 21 additions & 17 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

Expand All @@ -26,21 +25,17 @@ If you are reporting a bug, please include:
Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

xdatasets could always use more documentation, whether as part of the
official xdatasets docs, in docstrings, or even on the web in blog posts,
articles, and such.
xdatasets could always use more documentation, whether as part of the official xdatasets docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -117,9 +112,11 @@ Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in ``README.rst``.
3. The pull request should work for Python 3.8, 3.9, 3.10, and 3.11. Check that the tests pass for all supported Python versions.
#. The pull request should include tests.

#. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in ``README.rst``.

#. The pull request should work for Python 3.8, 3.9, 3.10, and 3.11. Check that the tests pass for all supported Python versions.

Tips
----
Expand All @@ -133,13 +130,20 @@ Versioning/Tagging

A reminder for the maintainers on how to deploy. This section is only relevant for maintainers when they are producing a new point release for the package.

In a new branch, make sure all your release information has been committed (in ``CHANGES.rst``). Then run::
#. Create a new branch from `main` (e.g. `release-0.2.0`).
#. Update the `CHANGES.rst` file to change the `Unreleased` section to the current date.
#. 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:

.. code-block:: shell
$ bump-my-version bump minor # In most cases, we will be releasing a minor version
$ git push
$ git push --tags
$ bumpversion patch # possible: major / minor / patch
$ git push
$ git push --tags
This will trigger the CI to build the package and upload it to TestPyPI. In order to upload to PyPI, this can be done by publishing a new version on GitHub. This will then trigger the workflow to build and upload the package to PyPI.

This will trigger the CI to build the package and upload it to TestPyPI. In order to upload to PyPI, this can be done by publishing a new version on GitHub. This will trigger the workflow to build and upload the package to PyPI.
#. Once the release is published, it will go into a `staging` mode on Github Actions. Once the tests pass, admins can approve the release (an e-mail will be sent) and it will be published on PyPI.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ clean-test: ## remove test and coverage artifacts

lint/flake8: ## check style with flake8
ruff xdatasets tests
flake8 --config=setup.cfg xdatasets tests
flake8 --config=.flake8 xdatasets tests

lint/black: ## check style with black
black --check xdatasets tests
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
# Dev tools and testing
- black >=23.11.0
- blackdoc >=0.3.9
- bump2version >=1.0.1
- bump-my-version >=0.12.0
- coverage >=6.2.0,<7.0.0
- coveralls >=3.3.1
- flake8 >=6.1.0
Expand Down
27 changes: 26 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dev = [
# Dev tools and testing
"black[jupyter]>=23.11.0",
"blackdoc>=0.3.9",
"bump2version>=1.0.1",
"bump-my-version>=0.12.0",
"coverage",
"coverage>=6.2.2,<7.0.0",
"coveralls>=3.3.1",
Expand Down Expand Up @@ -131,6 +131,30 @@ target-version = [
"py311"
]

[tool.bumpversion]
current_version = "0.3.0"
commit = true
tag = true
tag_name = "{new_version}"
allow_dirty = false
serialize = ["{major}.{minor}.{patch}"]
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"

[[tool.bumpversion.files]]
filename = "xdatasets/__init__.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "tests/test_xdatasets.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = ".cruft.json"
search = "\"version\": \"{current_version}\""
replace = "\"version\": \"{new_version}\""

[tool.coverage.run]
relative_files = true
include = ["xdatasets/*"]
Expand Down Expand Up @@ -164,6 +188,7 @@ exclude = [
".coveralls.yml",
".cruft.json",
".editorconfig",
".flake8",
".gitignore",
".nojekyll",
".pre-commit-config.yaml",
Expand Down
51 changes: 0 additions & 51 deletions setup.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ commands_pre =
pip list
pip check
commands =
pytest --cov
pytest --cov xdatasets
# Coveralls requires access to a repo token set in .coveralls.yml in order to report stats
coveralls: - coveralls

0 comments on commit 33bc8f9

Please sign in to comment.