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

Employ a src-based layout for code base #1971

Merged
merged 11 commits into from
Dec 10, 2024
Merged

Employ a src-based layout for code base #1971

merged 11 commits into from
Dec 10, 2024

Conversation

Zeitsperre
Copy link
Collaborator

@Zeitsperre Zeitsperre commented Oct 22, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGELOG.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • Adapts the code base to use a src-based layout (in lieu of a flat code base layout)
  • Added a stricter yamllint configuration (no changes made to existing YAML files)
  • Pins pint to >=0.24.4 in order to support Python3.13 (and evade failures from flexparser>=0.4).

Does this PR introduce a breaking change?

Yes. The code base has been modified such that existing interactive (--editable) installations will need to be re-installed.

This change prevents developers from accidentally running tests or importing xclim from the root directory. That's essentially the major gain.

Otherwise, we can say that this brings xclim closer in line with the other Ouranosinc/cookiecutter-pypackage template-based projects.

Other information:

https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#the-src-layout-and-testing

@Zeitsperre Zeitsperre self-assigned this Oct 22, 2024
Copy link

Note

It appears that this Pull Request modifies the main.yml workflow.

On inspection, the XCLIM_TESTDATA_BRANCH environment variable is set to the most recent tag (v2024.8.23).

No further action is required.

@github-actions github-actions bot added information For development/intsructional purposes CI Automation and Contiunous Integration docs Improvements to documenation labels Oct 22, 2024
@Zeitsperre Zeitsperre requested a review from a team November 8, 2024 17:01
pyproject.toml Outdated Show resolved Hide resolved
.yamllint.yaml Show resolved Hide resolved
Copy link
Contributor

@coxipi coxipi left a comment

Choose a reason for hiding this comment

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

Looks good to me. Some lines add options (e.g. when cli is invoked, new options I don't know about), and I'm not too familiar with these commands

@github-actions github-actions bot added the approved Approved for additional tests label Nov 11, 2024
@Zeitsperre
Copy link
Collaborator Author

The changes to CLI were needed since the location of CHANGELOG.rst can change depending on how the library is installed. It won't necessarily be found two levels above anymore, so passing this file directly via the command line is now permitted.

@coveralls
Copy link

Coverage Status

coverage: 89.75% (+0.4%) from 89.398%
when pulling ebf4588 on use-src
into d5aefa4 on main.

@Zeitsperre Zeitsperre added this to the v0.54.0 milestone Nov 12, 2024
Copy link
Collaborator

@aulemahal aulemahal left a comment

Choose a reason for hiding this comment

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

Looks good!

@Zeitsperre Zeitsperre merged commit 48a608e into main Dec 10, 2024
23 checks passed
@Zeitsperre Zeitsperre deleted the use-src branch December 10, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests CI Automation and Contiunous Integration docs Improvements to documenation information For development/intsructional purposes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants