Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maint/modernize #76

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9299add
MNT: Update enum parsing
Feb 5, 2024
2734e0b
DOC: add version of xarray
Feb 7, 2024
f255474
ENH: Migrate to pyproject.toml
Feb 7, 2024
60e0de0
maint: Make use of ouranos' cookiecutter
Feb 14, 2024
e77865d
Merge remote-tracking branch 'origin/main' into maint/modernize
Apr 12, 2024
616a589
maint: migrate .github from cookiecutter
Apr 15, 2024
c50ba40
maint: Apply code review suggestions
Apr 15, 2024
26ce02a
enh: Add bump-my-version template for CHANGELOG
Apr 15, 2024
45a4476
fix: lint issues
May 3, 2024
286ac06
fix: remove tox 38
May 7, 2024
131fcb6
maint: Remove bump templating of CHANGELOG
May 13, 2024
9457db2
maint: Create releasing.rst
May 13, 2024
365223b
update authors and maintainers
Zeitsperre May 13, 2024
5d2c9ab
Merge branch 'maint/modernize' of https://github.com/xarray-contrib/x…
May 14, 2024
9e066b7
enh: Upgrade via latest cookicutter template
May 14, 2024
5c42528
fix: lint
May 14, 2024
328c28a
fix: Makefile
May 14, 2024
8579ce3
maint: migrate from black to ruff format
May 14, 2024
1aa5188
fast-forward cookiecutter
Zeitsperre May 21, 2024
51ffa68
last adjustments
Zeitsperre May 21, 2024
401dd1f
add CODE_OF_CONDUCT.md
Zeitsperre Jul 5, 2024
71e83c9
fast-forward cookiecutter template
Zeitsperre Jul 5, 2024
ded5681
disable pre-commit ci for now
Zeitsperre Jul 5, 2024
ef1ead4
do not run pyupgrade yet
Zeitsperre Jul 5, 2024
585e6e1
run safe fixes, set ignored ruff violations
Zeitsperre Jul 5, 2024
cef99b0
fix coverage configuration
Zeitsperre Jul 5, 2024
f21df8e
fix coveralls reporting
Zeitsperre Jul 5, 2024
445b7e8
re-enable pre-commit ci
Zeitsperre Jul 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

30 changes: 30 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage.git",
"commit": "58525bb6c287ad11c874d7b8531c3597232e2d93",
"checkout": null,
"context": {
"cookiecutter": {
"full_name": "Abel Aoun",
"email": "[email protected]",
"github_username": "xarray-contrib",
"project_name": "xncml",
"project_slug": "xncml",
"project_short_description": "Tools for manipulating NcML (NetCDF Markup Language) files with/for xarray",
"pypi_username": "bzah",
"version": "0.5.0",
"use_pytest": "y",
"use_black": "n",
"use_conda": "n",
"add_pyup_badge": "n",
"make_docs": "y",
"add_translations": "n",
"command_line_interface": "No command-line interface",
"create_author_file": "y",
"open_source_license": "Apache Software License 2.0",
"generated_with_cruft": "y",
"__gh_slug": "https://github.com/xarray-contrib/xncml",
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage.git"
}
},
"directory": null
}
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.{yaml,yml}]
indent_size = 2

[*.bat]
indent_style = tab
end_of_line = crlf

[LICENSE]
insert_final_newline = false

[Makefile]
indent_style = tab
27 changes: 27 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[flake8]
exclude =
.eggs,
.git,
build,
docs,
tests
ignore =
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
1 change: 0 additions & 1 deletion .git_archival.txt

This file was deleted.

20 changes: 3 additions & 17 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
Thanks for submitting an issue!

Here's a quick checklist in what to include:

- [ ] Include a detailed description of the bug or suggestion
- [ ] `conda list` of the conda environment you are using
- [ ] Minimal, self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report:

- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)

Bug reports that follow these guidelines are easier to diagnose,
and so are often handled much more quickly.


* xncml version:
* Python version:
* Operating System:

### Description

```
Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
```

### What I Did

Expand Down
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/0001-GENERIC-ISSUE-TEMPLATE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Generic issue template
description: For detailing generic/uncategorized issues in xncml

body:
- type: textarea
id: generic-issue
attributes:
label: Generic Issue
description: Please fill in the following information fields as needed.
value: |
* xncml version:
* Python version:
* Operating System:

### Description
<!--Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.-->

### What I Did
<!--Paste the command(s) you ran and the output.
If there was a crash, please include the traceback below.-->
```
$ pip install foo --bar
```

### What I Received
<!--Paste the output or the stack trace of the problem you experienced here.-->
```
Traceback (most recent call last):
File "/path/to/file/script.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-9e1622b385b6>", line 1, in <module>
1/0
ZeroDivisionError: division by zero
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/0002-BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Bug report
description: Help us improve xncml
labels: [ "bug" ]

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: setup-information
attributes:
label: Setup Information
description: |
What software versions are you running? Example:
- xncml version: 0.55.0-gamma
- Python version: 4.2
- Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond"
value: |
- xncml version:
- Python version:
- Operating System:
- type: textarea
id: description
attributes:
label: Description
description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps To Reproduce
description: Paste the command(s) you ran and the output. If there was a crash, please include the traceback below.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
- type: checkboxes
id: submit-pr
attributes:
label: Contribution
description: Do you intend to submit a fix for this bug? (The xncml developers will help with code compliance)
options:
- label: I would be willing/able to open a Pull Request to address this bug.
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/0003-FEATURE-REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Feature request
description: Suggest an idea for xncml
labels: [ "enhancement" ]

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: problem
attributes:
label: Addressing a Problem?
description: Is your feature request related to a problem? Please describe it.
- type: textarea
id: potential-solution
attributes:
label: Potential Solution
description: Describe the solution you'd like to see implemented.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the feature request here.
- type: checkboxes
id: submit-pr
attributes:
label: Contribution
description: Do you intend to submit a fix for this bug? (The xncml developers will help with code compliance)
options:
- label: I would be willing/able to open a Pull Request to contribute this feature.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Question/Support
description: Ask for help from the developers
labels: [ "support" ]

body:
- type: textarea
id: setup-information
attributes:
label: Setup Information
description: |
What software versions are you running? Example:
- xncml version: 0.55.0-gamma
- Python version: 4.2
- Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond"
value: |
- xncml version:
- Python version:
- Operating System:
- type: textarea
id: description
attributes:
label: Context
description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
19 changes: 14 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
Thanks for submitting a PR, your contribution is really appreciated!
<!-- Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! -->
### Pull Request Checklist:
- [ ] This PR addresses an already opened issue (for bug fixes / features)
- This PR fixes #xyz
- [ ] (If applicable) Documentation has been added / updated (for bug fixes / features).
- [ ] (If applicable) Tests have been added.
- [ ] CHANGELOG.rst has been updated (with summary of main changes).
- [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added.

Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is just a guideline):
### What kind of change does this PR introduce?

* ...

- [ ] Include documentation when adding new features.
- [ ] Include new tests or update existing tests when applicable.
### Does this PR introduce a breaking change?

[summarize your pull request here]

### Other information:
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /.github/workflows/
schedule:
interval: monthly
open-pull-requests-limit: 10

- package-ecosystem: pip
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
89 changes: 89 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This workflow requires a personal access token named `BUMP_VERSION_TOKEN` with the following privileges:
# - Contents: Read and Write
# - Metadata: Read-Only
# - Pull Requests: Read and Write

name: "Bump Patch Version"

on:
push:
branches:
- main
paths-ignore:
- .cruft.json
- .editorconfig
- .github/**.yml
- .gitignore
- .pre-commit-config.yaml
- .yamllint.yaml
- .zenodo.json
- AUTHORS.rst
- CHANGELOG.rst
- CONTRIBUTING.rst
- Makefile
- .readthedocs.yml
- docs/*.py
- docs/*.rst
- environment-docs.yml
- pyproject.toml
- tests/**.py
- tox.ini
- src/xncml/__init__.py
workflow_dispatch:

permissions:
contents: read

jobs:
bump_patch_version:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout Repository (no persist-credentials)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python3
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.x"
- name: Config Commit Bot
run: |
git config --local user.email "bumpversion[bot]@ouranos.ca"
git config --local user.name "bumpversion[bot]"
- name: Install bump-my-version
run: |
python -m pip install "bump-my-version>=0.18.3"
- name: Current Version
run: |
bump-my-version show current_version
CURRENT_VERSION="$(grep -E '__version__' src/xncml/__init__.py | cut -d ' ' -f3)"
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Conditional Bump Version
run: |
if [[ ${{ env.CURRENT_VERSION }} =~ -dev(\.\d+)? ]]; then
echo "Development version (ends in 'dev(\.\d+)?'), bumping 'build' version"
bump-my-version bump build
else
echo "Version is stable, bumping 'patch' version"
bump-my-version bump patch
fi
bump-my-version show-bump
- name: Push Changes
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0
with:
force: false
github_token: ${{ secrets.BUMP_VERSION_TOKEN }}
branch: ${{ github.ref }}
Loading