Skip to content

Commit 1a2a87f

Browse files
bzahAbel AounfmigneaultZeitsperrehuard
authored
Maint/modernize (#76)
This PR fixes #69. The aim is to modernize the tooling surrounding `xncml`, including but not limited to: - migrate from `setup.py` to `pyproject.toml` - Make use of `ruff` instead of `flake8`, `isort`, `black`, etc. - Use the src layout as described in https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/ This also adds a `.cruft.json` file coming from the use of [cruft](https://github.com/cruft/cruft) with the [Ouranosinc template](https://github.com/Ouranosinc/cookiecutter-pypackage). Cruft can then be used to update the project structure whenever the template is updated. However, the `xncml` project already diverged a little from the original template: - `CHANGES.rst` is renamed CHANGELOG.rst - `docs/usage.rst` is superseded by `docs/tutorial.ipynb` - `ruff` format replaces `black` # Breaking changes - Python3.9 has been dropped, Python3.13 support has been added. - The build system is now using `flit` instead of setuptools. - setup.py was removed. - __version__ is no longer fetched from git, but is instead hardcoded in xncml/__init__.py - All workflows have been replaced - Publishing to TestPyPI and PyPI are now handled via Trusted Publishing - Testing uses `tox` and reports directly to coveralls.io - Many other small changes to aid with maintainability - Documentation now uses `sphinx-apidoc` to generate an API map that is exposed by ReadTheDocs - ReadTheDocs builds now fail when the generation step emits any warnings (for ensuring that the documentation is always working as intended) - `xncml.generated` no longer exposes the `ncml_2_2.py` submodule (needed to prevent multiple targets for the same re-exported functions/modules). --------- Co-authored-by: Abel Aoun <[email protected]> Co-authored-by: Francis Charette-Migneault <[email protected]> Co-authored-by: Zeitsperre <[email protected]> Co-authored-by: David Huard <[email protected]>
1 parent 0cb00d0 commit 1a2a87f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4565
-2610
lines changed

.coveragerc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.cruft.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage.git",
3+
"commit": "760bcbb2540bd973d57ea1aa1f1b24759f6d0955",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"full_name": "Abel Aoun",
8+
"email": "[email protected]",
9+
"github_username": "xarray-contrib",
10+
"project_name": "xncml",
11+
"project_slug": "xncml",
12+
"project_short_description": "Tools for manipulating NcML (NetCDF Markup Language) files with/for xarray",
13+
"pypi_username": "bzah",
14+
"version": "0.5.0",
15+
"use_pytest": "y",
16+
"use_black": "n",
17+
"use_conda": "n",
18+
"add_pyup_badge": "n",
19+
"make_docs": "y",
20+
"add_translations": "n",
21+
"command_line_interface": "No command-line interface",
22+
"create_author_file": "y",
23+
"open_source_license": "Apache Software License 2.0",
24+
"generated_with_cruft": "y",
25+
"__gh_slug": "https://github.com/xarray-contrib/xncml",
26+
"_template": "https://github.com/Ouranosinc/cookiecutter-pypackage.git",
27+
"_commit": "760bcbb2540bd973d57ea1aa1f1b24759f6d0955"
28+
}
29+
},
30+
"directory": null
31+
}

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.{yaml,yml}]
14+
indent_size = 2
15+
16+
[*.bat]
17+
indent_style = tab
18+
end_of_line = crlf
19+
20+
[LICENSE]
21+
insert_final_newline = false
22+
23+
[Makefile]
24+
indent_style = tab

.flake8

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[flake8]
2+
exclude =
3+
.eggs,
4+
.git,
5+
build,
6+
docs,
7+
tests
8+
ignore =
9+
C,
10+
D,
11+
E,
12+
F,
13+
W503
14+
per-file-ignores =
15+
rst-roles =
16+
doc,
17+
mod,
18+
py:attr,
19+
py:attribute,
20+
py:class,
21+
py:const,
22+
py:data,
23+
py:func,
24+
py:meth,
25+
py:mod,
26+
py:obj,
27+
py:ref

.git_archival.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
1-
Thanks for submitting an issue!
2-
3-
Here's a quick checklist in what to include:
4-
5-
- [ ] Include a detailed description of the bug or suggestion
6-
- [ ] `conda list` of the conda environment you are using
7-
- [ ] 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:
8-
9-
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
10-
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
11-
12-
Bug reports that follow these guidelines are easier to diagnose,
13-
and so are often handled much more quickly.
14-
15-
1+
* xncml version:
2+
* Python version:
3+
* Operating System:
164

175
### Description
186

19-
```
207
Describe what you were trying to get done.
218
Tell us what happened, what went wrong, and what you expected to happen.
22-
```
239

2410
### What I Did
2511

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Generic issue template
2+
description: For detailing generic/uncategorized issues in xncml
3+
4+
body:
5+
- type: textarea
6+
id: generic-issue
7+
attributes:
8+
label: Generic Issue
9+
description: Please fill in the following information fields as needed.
10+
value: |
11+
* xncml version:
12+
* Python version:
13+
* Operating System:
14+
15+
### Description
16+
<!--Describe what you were trying to get done.
17+
Tell us what happened, what went wrong, and what you expected to happen.-->
18+
19+
### What I Did
20+
<!--Paste the command(s) you ran and the output.
21+
If there was a crash, please include the traceback below.-->
22+
```
23+
$ pip install foo --bar
24+
```
25+
26+
### What I Received
27+
<!--Paste the output or the stack trace of the problem you experienced here.-->
28+
```
29+
Traceback (most recent call last):
30+
File "/path/to/file/script.py", line 3326, in run_code
31+
exec(code_obj, self.user_global_ns, self.user_ns)
32+
File "<ipython-input-2-9e1622b385b6>", line 1, in <module>
33+
1/0
34+
ZeroDivisionError: division by zero
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Bug report
2+
description: Help us improve xncml
3+
labels: [ "bug" ]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
- type: textarea
11+
id: setup-information
12+
attributes:
13+
label: Setup Information
14+
description: |
15+
What software versions are you running? Example:
16+
- xncml version: 0.55.0-gamma
17+
- Python version: 4.2
18+
- Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond"
19+
value: |
20+
- xncml version:
21+
- Python version:
22+
- Operating System:
23+
- type: textarea
24+
id: description
25+
attributes:
26+
label: Description
27+
description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
28+
- type: textarea
29+
id: steps-to-reproduce
30+
attributes:
31+
label: Steps To Reproduce
32+
description: Paste the command(s) you ran and the output. If there was a crash, please include the traceback below.
33+
- type: textarea
34+
id: additional-context
35+
attributes:
36+
label: Additional context
37+
description: Add any other context about the problem here.
38+
- type: checkboxes
39+
id: submit-pr
40+
attributes:
41+
label: Contribution
42+
description: Do you intend to submit a fix for this bug? (The xncml developers will help with code compliance)
43+
options:
44+
- label: I would be willing/able to open a Pull Request to address this bug.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Feature request
2+
description: Suggest an idea for xncml
3+
labels: [ "enhancement" ]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this feature request!
10+
- type: textarea
11+
id: problem
12+
attributes:
13+
label: Addressing a Problem?
14+
description: Is your feature request related to a problem? Please describe it.
15+
- type: textarea
16+
id: potential-solution
17+
attributes:
18+
label: Potential Solution
19+
description: Describe the solution you'd like to see implemented.
20+
- type: textarea
21+
id: additional-context
22+
attributes:
23+
label: Additional context
24+
description: Add any other context about the feature request here.
25+
- type: checkboxes
26+
id: submit-pr
27+
attributes:
28+
label: Contribution
29+
description: Do you intend to submit a fix for this bug? (The xncml developers will help with code compliance)
30+
options:
31+
- label: I would be willing/able to open a Pull Request to contribute this feature.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Question/Support
2+
description: Ask for help from the developers
3+
labels: [ "support" ]
4+
5+
body:
6+
- type: textarea
7+
id: setup-information
8+
attributes:
9+
label: Setup Information
10+
description: |
11+
What software versions are you running? Example:
12+
- xncml version: 0.55.0-gamma
13+
- Python version: 4.2
14+
- Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond"
15+
value: |
16+
- xncml version:
17+
- Python version:
18+
- Operating System:
19+
- type: textarea
20+
id: description
21+
attributes:
22+
label: Context
23+
description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.

0 commit comments

Comments
 (0)