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
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ignore =
F,
W503
per-file-ignores =
xclim/core/locales.py:RST399
src/xclim/core/locales.py:RST399
rst-directives =
bibliography,
autolink-skip
Expand Down
10 changes: 5 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
'indicators':
- changed-files:
- any-glob-to-any-file:
- 'xclim/indicators/**/*'
- 'xclim/indices/**/_*.py'
- 'xclim/data/**/*.json'
- 'xclim/data/**/*.yml'
- 'src/xclim/indicators/**/*'
- 'src/xclim/indices/**/_*.py'
- 'src/xclim/data/**/*.json'
- 'src/xclim/data/**/*.yml'

'information':
- changed-files:
Expand All @@ -53,5 +53,5 @@
'sdba':
- changed-files:
- any-glob-to-any-file:
- 'xclim/sdba/**/*'
- 'src/xclim/sdba/**/*'
- 'tests/test_sdba/*.py'
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ on:
- environment.yml
- pylintrc
- pyproject.toml
- src/xclim/__init__.py
- tox.ini
- xclim/__init__.py

permissions:
contents: read
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
trust_level: 5
- name: Current Version
run: |
CURRENT_VERSION="$(grep -E '__version__' xclim/__init__.py | cut -d ' ' -f3)"
CURRENT_VERSION="$(grep -E '__version__' src/xclim/__init__.py | cut -d ' ' -f3)"
echo "current_version=${CURRENT_VERSION}"
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Install CI libraries
Expand All @@ -85,7 +85,7 @@ jobs:
echo "Version is stable, bumping 'patch' version"
bump-my-version bump patch
fi
NEW_VERSION="$(grep -E '__version__' xclim/__init__.py | cut -d ' ' -f3)"
NEW_VERSION="$(grep -E '__version__' src/xclim/__init__.py | cut -d ' ' -f3)"
echo "new_version=${NEW_VERSION}"
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
- name: Push Changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- Makefile
- pyproject.toml
- tox.ini
- xclim/__init__.py
- src/xclim/__init__.py
- docs/*/*.ipynb
- docs/*/*.py
- docs/*/*.rst
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- CHANGELOG.rst
- README.rst
- pyproject.toml
- xclim/__init__.py
- src/xclim/__init__.py
pull_request:
types:
- opened
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- CHANGELOG.rst
- README.rst
- pyproject.toml
- xclim/__init__.py
- src/xclim/__init__.py
schedule:
- cron: "0 0 * * *" # Daily “At 00:00” UTC
workflow_dispatch: # allows you to trigger the workflow run manually
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ parts/
sdist/
var/
wheels/
src/
*.egg-info/
.installed.cfg
*.egg
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
hooks:
- id: pyupgrade
args: ['--py39-plus']
exclude: 'xclim/core/indicator.py'
exclude: 'src/xclim/core/indicator.py'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand Down Expand Up @@ -91,7 +91,7 @@ repos:
hooks:
- id: blackdoc
additional_dependencies: [ 'black==24.10.0' ]
exclude: '(xclim/indices/__init__.py|docs/installation.rst)'
exclude: '(src/xclim/indices/__init__.py|docs/installation.rst)'
- id: blackdoc-autoupdate-black
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ build:
python: "mambaforge-22.9"
jobs:
pre_build:
- sphinx-apidoc -o docs/apidoc/ --private --module-first xclim xclim/testing/tests xclim/indicators xclim/indices
- sphinx-apidoc -o docs/apidoc/ --private --module-first src/xclim src/xclim/testing/tests src/xclim/indicators src/xclim/indices
- rm docs/apidoc/xclim.rst
- env SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance,noindex" sphinx-apidoc -o docs/apidoc/ --private --module-first xclim xclim/testing/tests
- env SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance,noindex" sphinx-apidoc -o docs/apidoc/ --private --module-first src/xclim src/xclim/testing/tests
- sphinx-build -b linkcheck docs/ _build/linkcheck || true

conda:
Expand Down
31 changes: 31 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,39 @@
---

rules:

brackets:
forbid: false
min-spaces-inside: 0
max-spaces-inside: 1

commas:
min-spaces-after: 1

document-start: disable

float-values:
require-numeral-before-decimal: true

hyphens:
max-spaces-after: 1

indentation:
indent-sequences: whatever
spaces: consistent

key-duplicates:
forbid-duplicated-merge-keys: true

line-length:
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
max: 120
level: warning

new-lines:
type: unix

trailing-spaces: {}

Zeitsperre marked this conversation as resolved.
Show resolved Hide resolved
truthy: disable
7 changes: 6 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ Changelog

v0.54.0 (unreleased)
--------------------
Contributors to this version: Trevor James Smith (:user:`Zeitsperre`),
Contributors to this version: Trevor James Smith (:user:`Zeitsperre`).

Breaking changes
----------------
* The minimum required version of `dask` has been increased to `2024.8.1`. `dask` versions at or above `2024.11` are not yet supported. (:issue:`1992`, :pull:`1991`).

Internal changes
^^^^^^^^^^^^^^^^
* `xclim` now uses a `src` layout for the codebase. Structure-dependent functions, documentation, and build commands have been adapted to reflect these changes. (:pull:`1971`).
* Added a more robust `yamllint` configuration to ensure that all YAML files are linted consistently. (:pull:`1971`).

v0.53.2 (2024-10-31)
--------------------
Contributors to this version: Éric Dupuis (:user:`coxipi`), Pascal Bourgault (:user:`aulemahal`), Trevor James Smith (:user:`Zeitsperre`).
Expand Down
Loading
Loading