Skip to content

Commit

Permalink
fast-forward cookiecutter, apply mamba v2.0 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Oct 2, 2024
1 parent 2a88896 commit 60148dc
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/Ouranosinc/cookiecutter-pypackage",
"commit": "fb24d9af1a97700633333a8c8246b3e504e865f7",
"commit": "1d9ee5f08d3e8e4f78a4aabb75e2ce4eff8750bf",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
18 changes: 15 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: github-actions
directory: /.github/workflows/
directory: /.github/workflows
schedule:
interval: monthly
open-pull-requests-limit: 10
groups:
actions:
patterns:
- "*"

- package-ecosystem: pip
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
groups:
ci:
patterns:
- "CI/*"
python:
patterns:
- "pyproject.toml"
47 changes: 25 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
Expand All @@ -48,17 +49,19 @@ jobs:
python -m tox -e lint
test-pypi:
name: Test with Python${{ matrix.python-version }} (Python${{ matrix.python-version }} + tox)
name: Test with Python${{ matrix.python-version }} (tox, ${{ matrix.os }})
needs: lint
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
# - "3.13"
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
Expand All @@ -70,9 +73,15 @@ jobs:
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Environment Caching
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .tox
key: ${{ matrix.os }}-Python${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
- name: Test with tox
run: |
python -m tox
Expand All @@ -83,11 +92,12 @@ jobs:
COVERALLS_SERVICE_NAME: github

test-conda:
name: Test with Python${{ matrix.python-version }} (Anaconda)
name: Test with Python${{ matrix.python-version }} (Anaconda, ${{ matrix.os }})
needs: lint
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
defaults:
run:
Expand All @@ -103,18 +113,17 @@ jobs:
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0
with:
cache-downloads: true
cache-environment: true
environment-file: environment-dev.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Conda and Mamba versions
run: |
echo "micromamba $(micromamba --version)"
micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0).
- name: Install xsdba
run: |
python -m pip install --no-deps .
- name: Check versions
run: |
conda list
micromamba list
python -m pip check || true
- name: Test with pytest
run: |
Expand All @@ -133,19 +142,13 @@ jobs:
- test-pypi
- test-conda
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
sparse-checkout: |
CI/requirements_ci.txt
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Coveralls finished
run: |
python -m coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
disable-sudo: true
egress-policy: audit
- name: Coveralls Finished
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63 # v2.3.0
with:
parallel-finished: true
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0
uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # v1.10.1
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # 3.26.6
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # 3.26.6
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/tag-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0
uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241 # v1.10.1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
rev: v3.17.0
hooks:
- id: pyupgrade
args: [ '--py38-plus' ]
args: [ '--py39-plus' ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down Expand Up @@ -57,7 +57,8 @@ repos:
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: [ 'black==24.4.2' ]
additional_dependencies: [ 'black==24.8.0' ]
- id: blackdoc-autoupdate-black
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
Expand Down
10 changes: 4 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,23 @@
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst']
# You can specify multiple suffix as a dictionary of suffix: filetype
source_suffix = {'.rst': 'restructuredtext'}

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'xsdba'
copyright = "2024, Trevor James Smith"
copyright = "2024, Ouranosinc, Éric Dupuis, Trevor James Smith"
author = "Trevor James Smith"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
# the built documents.
#
# The short X.Y version.
version = xsdba.__version__
version = xsdba.__version__.split('-')[0]
# The full version, including alpha/beta/rc tags.
release = xsdba.__version__

Expand Down
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython"
]
dynamic = ["description", "version"]
Expand All @@ -38,12 +39,12 @@ dependencies = [
dev = [
# Dev tools and testing
"pip >=24.2.0",
"bump-my-version >=0.25.1",
"bump-my-version >=0.26.0",
"watchdog >=4.0.0",
"flake8 >=7.1.1",
"flake8-rst-docstrings >=0.3.0",
"flit >=3.9.0,<4.0",
"tox >=4.17.1",
"tox >=4.18.0",
"coverage >=7.5.0",
"coveralls >=4.0.1",
"mypy",
Expand Down Expand Up @@ -89,7 +90,8 @@ target-version = [
"py39",
"py310",
"py311",
"py312"
"py312",
"py313"
]

[tool.bumpversion]
Expand Down Expand Up @@ -157,6 +159,9 @@ values = [
"release"
]

[tool.coverage.paths]
source = ["src/xsdba/", "*/site-packages/xsdba/"]

[tool.coverage.run]
omit = ["tests/*.py"]
relative_files = true
Expand Down Expand Up @@ -206,7 +211,7 @@ py_version = 38

[tool.mypy]
files = "."
python_version = 3.9
python_version = 3.8
show_error_codes = true
strict = true
warn_no_return = true
Expand Down Expand Up @@ -254,7 +259,6 @@ testpaths = "tests"
[tool.ruff]
src = ["xsdba"]
line-length = 150
target-version = "py38"
exclude = [
".eggs",
".git",
Expand Down
2 changes: 1 addition & 1 deletion src/xsdba/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###################################################################################
# Apache Software License 2.0
#
# Copyright (c) 2024, Trevor James Smith
# Copyright (c) 2024, Ouranos Inc., Éric Dupuis, Trevor James Smith
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[tox]
min_version = 4.17.1
min_version = 4.18.0
envlist =
lint
py{38,39,310,311,312}
py{39,310,311,312,313}
docs
coveralls
requires =
flit ~= 3.9.0
flit >= 3.9.0,<4.0
pip >= 24.2.0
opts =
--verbose
Expand All @@ -18,6 +17,7 @@ python =
3.10 = py310-coveralls
3.11 = py311-coveralls
3.12 = py312-coveralls
3.13 = py313-coveralls

[testenv:lint]
skip_install = True
Expand Down

0 comments on commit 60148dc

Please sign in to comment.