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

Style switch to ruff format #1652

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft

Conversation

jackvreeken
Copy link
Collaborator

@jackvreeken jackvreeken commented Feb 4, 2025

SGeeversAtVortech and others added 28 commits October 8, 2024 11:52
workflows: add work flow based on the gitlab ci workflow
Use the correct workflow status badge in the README.md.
Provide some information on the migration from gitlab to github
and how to update the git remote url.
Update the autogenereted versioneer.py and _version.py files
with the latest versioneer package.
This makes versioneer compatible with python 3.12.
Remove the upper limit on numpy and scipy versions.
The older versions are no longer compatible with python 3.12.
Fix string-to-datetime/float conversions in loading csv files
for latest numpy version.
With the latest numpy.genfromtxt, strings are not always passed
to converters in byte format but sometimes in plain text format.
Fix the except clause when model transferring a model failed
due to an incompatible cache file.
Raise the error only when no cache file was used.
Use -999 instead of nan when missing values are indicated by -999.
Include tests using python 3.12.
Move the cross reference just above the section name,
instead of in the middle of the section.

Sphinx expects references to be just above sections/figures/tables.
Update install instructions for Python 3.12.
Installing rtc-tools with Python 3.12 requires installation of
setuptools.
Use np.genfromtxt instead of np.recfromcsv,
since the latter is deprecated.
Remove the deprecated function get_html_theme_path.
Python 3.8 is EOL since October 2024. Note that we already stopped
running the CI/CD pipeline on 3.8 .
Because we are running on GitHub now, this file is no longer needed and
only confuses e.g. find/replace in editors.
Adding a separate workflow for deploying is possible, but to _also_ make
it depend on the tests succeeding is difficult. We would have to use the
`workflow_run` event, but that one cannot filter on tags, only on
branches. As such, we might as well add it to the overall workflow.
The examples are only run for tags, we can therefore be rather sure that
most stages of the pipeline will succeed. To save a little bit of time,
we can run the examples job in parallel with the other tests and
coverage, especially because the examples take quite a while to run.

Note that we add coverage as an explicit dependency to the deploy job,
and as such sill require all jobs to succeed before deploying like.
There is no passing of xml reports from the testing jobs to the coverage
job, so we can speed up the overall pipeline by running coverage in
parallel.
We already use the more modern "python -m build" during the deploy
stage; so we bring the 'build' stage in line with that.
The pkg_resources package is deprecated, although still available if
(manually) installing setuptools. A more modern approach is the usage of
"importlib", available since Python 3.9. Note that we do require a
change to "entry_point" accepting a group parameter that was introduced
with Python 3.10, so we fall back to a version of "importlib_metadata"
that support this. Also note that we also only require this external
(backport) dependency for Python 3.9.
This makes the pre-commit hooks faster still, and leverages the extra
capabilities of a dependency we already have anyway.

Note that we bump the version of Ruff as well, and update the
pyproject.toml to use the recommended "lint.ignore" instead of just
"ignore".
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.

4 participants