From 21ad4ce8df9b1f5ea5cbceb0a31f9aa114a1f11c Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 11 Jul 2023 13:16:14 +0200 Subject: [PATCH] Update template --- .cruft.json | 2 +- .github/workflows/on-push.yml | 35 +++++++------- .gitignore | 88 ++++++++++++++++++++++++++++++++--- .gitignore.rej | 63 +++++++++++++++++++++++++ .pre-commit-config-cruft.yaml | 2 +- .pre-commit-config.yaml | 10 ++-- pyproject.toml | 1 + 7 files changed, 169 insertions(+), 32 deletions(-) create mode 100644 .gitignore.rej diff --git a/.cruft.json b/.cruft.json index cbb399bd..9488112d 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/ecmwf-projects/cookiecutter-conda-package", - "commit": "0eda714719b5141d8e570e2c751572b41fefc2d7", + "commit": "9627920059b31038e1bb8a978921806cb835fde7", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 09d91e79..0a456445 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -48,9 +48,12 @@ jobs: path: ci/combined-environment-*.yml unit-tests: - name: unit-tests (3.10) + name: unit-tests needs: combine-environments runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.10', '3.11'] steps: - uses: actions/checkout@v3 @@ -60,14 +63,13 @@ jobs: name: combined-environments path: ci - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + uses: mamba-org/setup-micromamba@v1 with: environment-file: ci/combined-environment-ci.yml environment-name: DEVELOP - channels: conda-forge - cache-env: true - extra-specs: | - python=3.10 + cache-environment: true + create-args: >- + python=${{ matrix.python-version }} - name: Install package run: | python -m pip install --no-deps -e . @@ -87,13 +89,12 @@ jobs: name: combined-environments path: ci - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + uses: mamba-org/setup-micromamba@v1 with: environment-file: ci/combined-environment-ci.yml environment-name: DEVELOP - channels: conda-forge - cache-env: true - extra-specs: | + cache-environment: true + create-args: >- python=3.10 - name: Install package run: | @@ -114,13 +115,12 @@ jobs: name: combined-environments path: ci - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + uses: mamba-org/setup-micromamba@v1 with: environment-file: ci/combined-environment-ci.yml environment-name: DEVELOP - channels: conda-forge - cache-env: true - extra-specs: | + cache-environment: true + create-args: >- python=3.10 - name: Install package run: | @@ -149,13 +149,12 @@ jobs: name: combined-environments path: ci - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + uses: mamba-org/setup-micromamba@v1 with: environment-file: ci/combined-environment${{ matrix.extra }}.yml environment-name: DEVELOP${{ matrix.extra }} - channels: conda-forge - cache-env: true - extra-specs: | + cache-environment: true + create-args: >- python=${{ matrix.python-version }} - name: Install package run: | diff --git a/.gitignore b/.gitignore index b9ceae3e..2197b45c 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,52 @@ ipython_config.py # Remove previous ipynb_checkpoints # git rm -r .ipynb_checkpoints/ +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + ### PyCharm ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 @@ -150,7 +196,6 @@ __pycache__/ .Python build/ develop-eggs/ -dist/ downloads/ eggs/ .eggs/ @@ -296,6 +341,16 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + ### Vim ### # Swap [._]*.s[a-v][a-z] @@ -311,7 +366,6 @@ Sessionx.vim # Temporary .netrwhist -*~ # Auto-generated tag files tags # Persistent undo @@ -337,10 +391,30 @@ tags .history .ionide -# Support for Project snippet scope -.vscode/*.code-snippets +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp -# Ignore code-workspaces -*.code-workspace +# Windows shortcuts +*.lnk -# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm +# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows diff --git a/.gitignore.rej b/.gitignore.rej new file mode 100644 index 00000000..8c521bd5 --- /dev/null +++ b/.gitignore.rej @@ -0,0 +1,63 @@ +diff a/.gitignore b/.gitignore (rejected hunks) +@@ -4,8 +4,59 @@ version.py + # Sphinx automatic generation of API + docs/_api/ + +-# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm +-# Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks,vim,visualstudiocode,pycharm ++# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows ++# Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows ++ ++### Emacs ### ++# -*- mode: gitignore; -*- ++*~ ++\#*\# ++/.emacs.desktop ++/.emacs.desktop.lock ++*.elc ++auto-save-list ++tramp ++.\#* ++ ++# Org-mode ++.org-id-locations ++*_archive ++ ++# flymake-mode ++*_flymake.* ++ ++# eshell files ++/eshell/history ++/eshell/lastdir ++ ++# elpa packages ++/elpa/ ++ ++# reftex files ++*.rel ++ ++# AUCTeX auto folder ++/auto/ ++ ++# cask packages ++.cask/ ++dist/ ++ ++# Flycheck ++flycheck_*.el ++ ++# server auth directory ++/server/ ++ ++# projectiles files ++.projectile ++ ++# directory configuration ++.dir-locals.el ++ ++# network security ++/network-security.data ++ + + ### JupyterNotebooks ### + # gitignore template for Jupyter Notebooks diff --git a/.pre-commit-config-cruft.yaml b/.pre-commit-config-cruft.yaml index 68298ad4..b55f24f1 100644 --- a/.pre-commit-config-cruft.yaml +++ b/.pre-commit-config-cruft.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/cruft/cruft - rev: 2.12.0 + rev: 2.15.0 hooks: - id: cruft entry: cruft update -y diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a539678a..5010adbe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: debug-statements - id: mixed-line-ending - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/keewis/blackdoc @@ -19,17 +19,17 @@ repos: hooks: - id: blackdoc additional_dependencies: [black==22.3.0] -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.254 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.277 hooks: - id: ruff - args: [--fix] + args: [--fix, --show-fixes] - repo: https://github.com/executablebooks/mdformat rev: 0.7.16 hooks: - id: mdformat - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.7.0 + rev: v2.9.0 hooks: - id: pretty-format-yaml args: [--autofix, --preserve-quotes] diff --git a/pyproject.toml b/pyproject.toml index 9344bda4..8fb8de34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,7 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering" ] dependencies = [