Skip to content

Commit

Permalink
chore: update project structure to 0a6fca5a
Browse files Browse the repository at this point in the history
  • Loading branch information
collijk authored Dec 28, 2024
1 parent c6013ca commit 8755401
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 25 deletions.
5 changes: 3 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/collijk/python-package-cookiecutter",
"commit": "7e9285f84cc6b52165dbc97b9a0d4f059d0f6818",
"commit": "0a6fca5a3df116e2596adc8e8c7a0e5899e72352",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -11,7 +11,8 @@
"project_slug": "climate-data",
"package_name": "climate_data",
"project_short_description": "Pipelines to extract, format, and downscale ERA5 and CMIP6 data.",
"_template": "https://github.com/collijk/python-package-cookiecutter"
"_template": "https://github.com/collijk/python-package-cookiecutter",
"_commit": "0a6fca5a3df116e2596adc8e8c7a0e5899e72352"
}
},
"directory": null
Expand Down
21 changes: 21 additions & 0 deletions .github/alternative_workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and Deploy Docs

on:
workflow_dispatch:
pull_request:
branches:
- main
types:
- closed

jobs:
build-and-deploy-docs:
if: ${{ github.event.pull_request.merged }} or ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: ./.github/actions/python-poetry-env
- name: Deploy docs
run: poetry run mkdocs gh-deploy --force
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks)
@@ -25,11 +25,6 @@ repos:
# Add --fix, in case you want it to autofix when this hook runs
entry: poetry run ruff check --force-exclude --fix
require_serial: true
- - id: ruff
- name: ruff
- # Add --fix, in case you want it to autofix when this hook runs
- entry: poetry run ruff check --force-exclude
- require_serial: true
language: system
types: [ python ]
- id: mypy
34 changes: 34 additions & 0 deletions mkdocs.yml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff a/mkdocs.yml b/mkdocs.yml (rejected hunks)
@@ -14,9 +14,9 @@ theme:
name: Switch to light mode

nav:
- - Introduction: 'index.md'
- - api_docs.md
- - changelog.md
+ - Home: 'index.md'
+ - Code Reference: reference/
+ - Changelog: changelog.md

watch:
- src/climate_data
@@ -61,6 +61,12 @@ markdown_extensions:
plugins:
- table-reader
- search
+ - gen-files:
+ scripts:
+ - scripts/gen_ref_pages.py
+ - literate-nav:
+ nav_vile: SUMMARY.md
+ - section-index
- mkdocstrings:
default_handler: python
handlers:
@@ -73,5 +79,5 @@ extra_javascript:
- https://unpkg.com/[email protected]/dist/tablesort.min.js
- _javascript/tablesort.js
- _javascript/mathjax.js
- - https://polyfill.io/v3/polyfill.min.js?features=es6
+ - https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
50 changes: 50 additions & 0 deletions pyproject.toml.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff a/pyproject.toml b/pyproject.toml (rejected hunks)
@@ -34,9 +34,12 @@ python = ">=3.10, <4.0"
click = "*"

[tool.poetry.group.dev.dependencies]
-mkdocstrings = {version = ">=0.23", extras = ["python"]}
+mkdocstrings = {version = "*", extras = ["python"]}
mkdocs-material = "*"
mkdocs-table-reader-plugin = "*"
+mkdocs-gen-files = "*"
+mkdocs-literate-nav = "*"
+mkdocs-section-index = "*"
mypy = "*"
pre-commit = "*"
pymdown-extensions = "*"
@@ -44,13 +47,13 @@ pytest = "*"
pytest-github-actions-annotate-failures = "*"
pytest-cov = "*"
python-kacl = "*"
-ruff = ">=0.2.0"
+ruff = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

-[project.scripts]
+[tool.poetry.scripts]
my-cli = "climate_data.cli:main"

[tool.ruff]
@@ -78,6 +81,9 @@ ignore = [
"ARG", # "Unused function argument". Fixtures are often unused.
"S105", # "Possible hardcoded password".
]
+"scripts/**" = [
+ "INP001", # "Scripts are not part of a package."
+]

[tool.ruff.lint.mccabe]
max-complexity = 10
@@ -90,7 +96,7 @@ classmethod-decorators = [
]

[tool.ruff.lint.flake8-tidy-imports]
-ban-relative-imports = true
+ban-relative-imports = "all"

[tool.pytest.ini_options]
addopts = """\
46 changes: 23 additions & 23 deletions src/climate_data/cli_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,36 +236,36 @@ def with_overwrite() -> ClickOption[_P, _T]:


__all__ = [
"VALID_HISTORY_YEARS",
"VALID_REFERENCE_YEARS",
"VALID_FORECAST_YEARS",
"VALID_MONTHS",
"VALID_DRAWS",
"VALID_ERA5_VARIABLES",
"VALID_ERA5_DATASETS",
"VALID_CMIP6_SOURCES",
"VALID_CMIP6_EXPERIMENTS",
"STRIDE",
"LATITUDES",
"LONGITUDES",
"with_year",
"with_month",
"RUN_ALL",
"STRIDE",
"VALID_CMIP6_EXPERIMENTS",
"VALID_CMIP6_SOURCES",
"VALID_DRAWS",
"VALID_ERA5_DATASETS",
"VALID_ERA5_VARIABLES",
"VALID_FORECAST_YEARS",
"VALID_HISTORY_YEARS",
"VALID_MONTHS",
"VALID_REFERENCE_YEARS",
"ClickOption",
"with_choice",
"with_cmip6_experiment",
"with_cmip6_source",
"with_debugger",
"with_draw",
"with_era5_variable",
"with_era5_dataset",
"with_cmip6_source",
"with_cmip6_experiment",
"with_era5_variable",
"with_input_directory",
"with_lat_start",
"with_lon_start",
"with_month",
"with_num_cores",
"with_output_directory",
"with_overwrite",
"with_progress_bar",
"with_queue",
"with_verbose",
"with_debugger",
"with_input_directory",
"with_num_cores",
"with_progress_bar",
"RUN_ALL",
"ClickOption",
"with_choice",
"with_overwrite",
"with_year",
]

0 comments on commit 8755401

Please sign in to comment.