Skip to content

Commit

Permalink
update to latest commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Nov 22, 2023
1 parent 698d928 commit 268ac65
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 79 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 @@ -46,9 +46,9 @@ jobs:
run: echo "current_version=$(grep -E '__version__' figanos/__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__' figanos/__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 @@ -102,7 +102,7 @@ jobs:
python -m pip check || true
- name: Test with pytest
run: |
python -m pytest --cov=figanos
python -m pytest --cov figanos
- 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
20 changes: 7 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ repos:
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: setup.cfg
- id: end-of-file-fixer
- id: debug-statements
- id: check-json
Expand All @@ -34,6 +33,12 @@ repos:
hooks:
- id: black
exclude: ^docs/
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [ '--profile=black', '--filter-files', "--add_imports='from __future__ import annotations'" ]
exclude: ^docs/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
Expand All @@ -43,18 +48,7 @@ repos:
hooks:
- id: flake8
additional_dependencies: [ 'flake8-alphabetize', 'flake8-rst-docstrings' ]
args: [ '--config=setup.cfg' ]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [ '--profile=black', '--filter-files', "--add_imports='from __future__ import annotations'" ]
exclude: ^docs/
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: [ '--convention=numpy', '--match="(?!test_).*\.py"' ]
args: [ '--config=.flake8' ]
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
Expand Down
29 changes: 19 additions & 10 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ 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
~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -113,9 +112,12 @@ 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 all major supported Python versions (3.8, 3.9, 3.10, and 3.11).
#. 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 @@ -129,13 +131,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 environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
- holoviews
# Development
- black
- bump2version
- bump-my-version >=0.12.0
- coverage >=6.2,<7.0
- coveralls >=3.3.1
- flake8
Expand Down
27 changes: 26 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies = [
dev = [
# Dev tools and testing
"pip>=23.3",
"bump2version>=1.0.1",
"bump-my-version>=0.12.0",
"watchdog>=3.0.0",
"flake8>=6.1.0",
"flake8-rst-docstrings>=0.3.0",
Expand Down Expand Up @@ -107,6 +107,30 @@ target-version = [
"py311"
]

[tool.bumpversion]
current_version = "0.2.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 = "figanos/__init__.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "tests/test_figanos.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 = ["figanos/*"]
Expand Down Expand Up @@ -141,6 +165,7 @@ exclude = [
"**/__pycache__",
".coveralls.yml",
".editorconfig",
".flake8",
".gitignore",
".pre-commit-config.yaml",
".readthedocs.yml",
Expand Down
50 changes: 0 additions & 50 deletions setup.cfg

This file was deleted.

0 comments on commit 268ac65

Please sign in to comment.