Skip to content

Conversation

@abel-bzz
Copy link
Collaborator

@abel-bzz abel-bzz commented Apr 12, 2024

Thanks for submitting a PR, your contribution is really appreciated!

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):

  • Include documentation when adding new features.
  • Include new tests or update existing tests when applicable.

[summarize your pull request here]

This PR fixes #69.
The aim is to modernize the tooling surrounding xncml, including but not limited to:

This also adds a .cruft.json file coming from the use of cruft with the Ouranosinc template.
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).

TODO

  • fix or add ignore of the rules for the pre-commit hook issues
  • Add a personal access token named BUMP_VERSION_TOKEN to enable bump-version workflow.
    • Disabled for now.
  • Add personal access token named OPENSSF_SCORECARD_TOKEN to enable scorecard workflow.
    • Disabled for now.
  • Register project on Coveralls, let GitHub manage tokens.

Abel Aoun added 4 commits February 6, 2024 17:40
This aligns xncml enum parsing behavior with xarray's
netCDF4 backend behavior.
- migrate builder from setuptools to flint
- migrate doc structure
- move sources to /src/xncml/ dir (was in /xncml)
- migrate mardown to rst
- update cookiecuttered files with relevant xncml info
@abel-bzz abel-bzz requested a review from Zeitsperre April 12, 2024 14:30
@abel-bzz
Copy link
Collaborator Author

This PR adds an AUTHORS.rst file with the information (including public github emails) from the recorded contributors: @andersy005, @huard, @Zeitsperre, @aulemahal, @fmigneault,
If you would prefer to not be mentioned, just comment on this PR I will remove it.

@abel-bzz
Copy link
Collaborator Author

Many thanks for your review @fmigneault, there are some xncml specific issues indeed, but I think most of your comments should first be applied to the cookiecutter template.
I can fix these issues here, but I think @Zeitsperre might be interested to upstream some of them.

Abel Aoun and others added 3 commits April 15, 2024 17:27
Co-authored-by: Francis Charette-Migneault <francis.charette.migneault@gmail.com>
Co-authored-by: Francis Charette-Migneault <francis.charette.migneault@gmail.com>
@Zeitsperre
Copy link
Collaborator

@bzah Thanks for the heads-up! I'm still coming back from my vacation, so I'll give this a look as soon as I can.

@fmigneault If you'd like to upstream a few of your changes so that the nearly 10+ projects using it can also benefit from your work, you are more than welcome to open a PR!

@fmigneault
Copy link
Collaborator

I'll let @bzah do it. I only did the proposals, but he did all the good work behind these commits 😉

@abel-bzz
Copy link
Collaborator Author

@Zeitsperre no worries, I will be working on this PR and upstream what's relevant in the coming weeks.

Abel Aoun added 2 commits May 3, 2024 14:44
xncml no longer support python 3.8
@abel-bzz
Copy link
Collaborator Author

abel-bzz commented May 8, 2024

It looks like numpy 2.0.0rc1 on python 3.12 breaks some automated tests. I will have a look and try to fix this in another PR.

Abel Aoun added 2 commits May 13, 2024 09:43
Moved the 'how to release' from the contributing guide to
a dedicated releasing.rst guide.
@Zeitsperre
Copy link
Collaborator

@bzah

Once the changes have been merged to the main branch of the template, I think we can fast-forward those changes here and safely merge!

@abel-bzz
Copy link
Collaborator Author

@Zeitsperre I will try to update this branch via cruft tomorrow. I'm away for a month on Wednesday, so I hope I can get something clean and we can merge this one before I leave.

…ors, use sphinx-autodoc, add module API to docs, remove numpydoc from sphinx extensions, docstring fixes
@Zeitsperre
Copy link
Collaborator

There is one small issue I'd like to mention here:

The documentation now includes the library API and is now using sphinx-autodoc/sphinx-autoapi to gather/generate these entries automatically (which is nice, IMO). There are a few issues with the structure though, specifically, xncml.generated (re-)exposes several classes that are also exposed via xncml.generated.ncml_2_2:

/home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Aggregation': xncml.generated.Aggregation, xncml.generated.ncml_2_2.Aggregation [ref.python]
/home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Netcdf': xncml.generated.Netcdf, xncml.generated.ncml_2_2.Netcdf [ref.python]
/home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Group': xncml.generated.Group, xncml.generated.ncml_2_2.Group [ref.python]
/home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Netcdf': xncml.generated.Netcdf, xncml.generated.ncml_2_2.Netcdf [ref.python]
/home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Dimension': xncml.generated.Dimension, xncml.generated.ncml_2_2.Dimension [ref.python]
/home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Netcdf': xncml.generated.Netcdf, xncml.generated.ncml_2_2.Netcdf [ref.python]
generating indices... /home/docs/checkouts/readthedocs.org/user_builds/xncml/checkouts/76/docs/apidoc/xncml.rst:31: WARNING: more than one target found for cross-reference 'Variable': xncml.generated.Variable, xncml.generated.ncml_2_2.Variable [ref.python]

The doc build is set to ignore this, but it would be good to know which file should be the "target".

@fmigneault
Copy link
Collaborator

Since the doc is generated to guide users, I would suggest that the "target" is the location that you want users to employ, or the one that is exposed, and hide the one that is there only to handle the project's logic.

Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ready for merging, IMO. I just need to double-check the environments for Trusted Publishing, but I think we have something solid to work with.

@Zeitsperre Zeitsperre requested review from fmigneault and huard May 2, 2025 15:04
@huard
Copy link
Collaborator

huard commented May 2, 2025

Unless I'm missing something, generated.init just imports classes from ncml_2_2. So the objects are exactly the same.

Co-authored-by: David Huard <huard.david@ouranos.ca>
@Zeitsperre
Copy link
Collaborator

One thing I will clarify: Like @bzah mentioned, the cookiecutter template is versioned and is periodically updated. I've been meaning to do that and will probably make a point to get that done over the summer. When changes are made there, the 10 or so downstream projects are updated as well.

Some of the changes I've been meaning to make there have been made here, so porting them should be very simple (that's the intended goal of using cruft).

@Zeitsperre Zeitsperre merged commit 1a2a87f into main May 5, 2025
11 checks passed
@Zeitsperre Zeitsperre deleted the maint/modernize branch May 5, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Migrate to pyproject.toml and ruff

6 participants