Skip to content

Commit

Permalink
Merge branch 'release/v0.12.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wpk committed Nov 4, 2024
2 parents 4de6354 + ffcf5a4 commit 3f379da
Show file tree
Hide file tree
Showing 115 changed files with 6,754 additions and 4,293 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/usnistgov/cookiecutter-nist-python.git",
"commit": "8fe5103d25de7e7d13d400f599c6653866a69afc",
"commit": "714e872b2f122570895ef79d72f5a364f6f9b12b",
"checkout": "develop",
"context": {
"cookiecutter": {
Expand Down
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
19 changes: 17 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,19 @@ ENV/
# mkdocs documentation
/site

# NOTE: use `/.mypy_cache/`, etc because want to flag those in other
# mypy
.mypy_cache/
.dmypy.json

# pytpe
.pytype/

# ruff
.ruff_cache

# PDF output
README.pdf

# IDE settings
.vscode/
Expand All @@ -117,6 +128,10 @@ cruft.patch
/pyproject2conda-feedstock*/
/src/**/_version.py
tuna-loadtime.log
/requirements/py*-dev.yaml
/requirements/py*-dev-user.yaml
/requirements/dev-user.txt
/requirements/lock/py*-dev-user-conda-lock.yml*
/requirements/lock/py*-dev-user.txt*

# other
/README.pdf
/requirements/lock/py*-dev-conda-lock.yml
192 changes: 104 additions & 88 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# pre-commit install
# pre-commit run --all-files
# See https://pre-commit.com for more information
Expand All @@ -9,137 +8,154 @@ default_install_hook_types:
repos:
# * Top level
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-yaml
- id: check-json
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: check-json
- id: check-toml
# * sync dependencies
# Put this first, because messes up formatting
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
# * Sync dependencies
- repo: https://github.com/mxr/sync-pre-commit-deps
rev: v0.0.1
hooks:
- id: sync-pre-commit-deps

# * Pyproject-fmt
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.4
hooks:
- id: pyproject-fmt
args: [--indent=4, --keep-full-version]
files: ^pyproject.toml$

# * Prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
rev: v4.0.0-alpha.8
hooks:
- id: prettier
alias: markdownlint
stages: [commit]
stages: [pre-commit]
additional_dependencies:
- prettier-plugin-toml
exclude: ^requirements/lock/.*[.]yml|^.copier-answers.ya?ml

# * Markdown
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.10.0
rev: v0.14.0
hooks:
- id: markdownlint-cli2
args: ["--style prettier"]
alias: markdownlint
args: [--style, prettier]

# * Linting
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.1.3"
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
# NOTE: nbQA for notebook formatting
- id: black
# To be replace by ruff analog when I find one ...
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.10.1
# exclude: ^README.md
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
- black==24.4.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.6
hooks:
- id: ruff
alias: ruff-all
types_or: &ruff-types-or [python, pyi, jupyter]
args: [--fix, --show-fixes]
- id: ruff-format
alias: ruff-all
types_or: *ruff-types-or

# * Spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: nbqa-ruff
additional_dependencies: [ruff==0.1.3]
- id: nbqa-black
additional_dependencies: [black==23.10.1]
- id: codespell
additional_dependencies: [tomli]
args: [-I, docs/spelling_wordlist.txt]
exclude_types: [jupyter]

# * Notebook spelling
# - repo: https://github.com/nbQA-dev/nbQA
# rev: 1.8.4
# hooks:
# - id: nbqa
# alias: nbqa-codespell
# name: nbqa-codespell
# additional_dependencies: &codespell-deps [codespell==2.2.6, tomli] # make sure same as above
# args:
# [codespell, --ignore-words=docs/spelling_wordlist.txt, --nbqa-shell]
# - id: nbqa
# alias: nbqa-codespell
# name: nbqa-codespell-markdown
# additional_dependencies: *codespell-deps
# args:
# [
# codespell,
# --ignore-words=docs/spelling_wordlist.txt,
# --nbqa-shell,
# --nbqa-md,
# ]

# * Strip out metadata from notebooks
# - repo: https://github.com/kynan/nbstripout
# rev: 0.7.1
# hooks:
# - id: nbstripout
# args: [
# --keep-output, # keep output (needed for nbval testing)
# --keep-count, # Errors with nbval without this...
# --extra-keys, # strip out kernelspec. If use this, always have to reselect kernel when open a notebook...
# "metadata.kernelspec metadata.kernel_spec",
# ]

# * Commit message
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.12.0
rev: v3.29.0
hooks:
- id: commitizen
stages: [commit-msg]

# * Manual Linting ------------------------------------------------------------
# * isort, pyupgrade, flake8 defer to ruff
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
stages: [manual]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.17.0
hooks:
- id: pyupgrade
stages: [manual]
args: [--py38-plus]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
stages: [manual]
additional_dependencies:
- flake8-docstrings
- Flake8-pyproject
# - pep8-naming
# - flake8-rst-docstrings
exclude: ^tests/|^src/pyproject2conda/tests/|^docs/conf.py|^setup.py
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade]
stages: [manual]
args: [--py38-plus]
- id: nbqa-isort
additional_dependencies: [isort]
stages: [manual]
# ** spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
# - repo: https://github.com/nbQA-dev/nbQA
# rev: 1.8.4
# hooks:
# - id: nbqa-pyupgrade
# additional_dependencies: [pyupgrade]
# stages: [manual]
# args: [--py38-plus]

# ** typos
# Probably stick with codespell, but this might also be nice...
- repo: https://github.com/crate-ci/typos
rev: v1.24.6
hooks:
- id: codespell
types_or: [python, rst, markdown, cython, c]
additional_dependencies: [tomli]
args: [-I, docs/spelling_wordlist.txt]
- id: typos
stages: [manual]

# - repo: local
exclude: "[.]ipynb$"
# - repo: https://github.com/nbQA-dev/nbQA
# rev: 1.8.4
# hooks:
# - id: mypy
# name: mypy
# entry: tox
# args: ["-e", "lint-mypy"]
# language: system
# pass_filenames: false
# # additional_dependencies: [tox]
# types: [python]
# require_serial: true
# - id: nbqa
# alias: nbqa-typos
# name: nbqa-typos
# additional_dependencies: &typos-deps [typos==1.19.0] # make sure save version as above.
# stages: [manual]
# - id: pyright
# name: pyright
# entry: pyright
# args: []
# language: system
# pass_filenames: true
# # additional_dependencies: [tox]
# types: [python]
# require_serial: true
# args: [typos, --nbqa-shell]
# - id: nbqa
# alias: nbqa-typos
# name: nbqa-typos-markdown
# additional_dependencies: *typos-deps
# stages: [manual]
# args: [typos, --nbqa-shell, --nbqa-md]
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore file for prettier
# Similar to .gitignore

# Use pyproject-fmt for pyproject.toml
pyproject.toml

# Don't fix yaml files under requirements/lock. These are created by conda-lock.
/requirements/lock/*.y*ml

# Don't fix copier answers
.copier-answers.y*ml
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,36 @@ See the fragment files in [changelog.d]

<!-- scriv-insert-here -->

## v0.12.0 — 2024-11-04

### Removed

- Removed comments based (`# p2c: ...`) support. Specify changes with
`tool.pyproject2conda.dependencies` table only. This greatly simplifies the
code, and has become the primary way to use the `pyproject2conda`.

### Added

- Added [PEP 735](https://peps.python.org/pep-0735/) support. This includes
adding option `--group` to the cli, and `groups` key to
`tools.pyproject2conda.envs....` tables. There is also an option
`--extra-or-group` (or `extras_or_groups` in pyproject.toml) that will first
try to find dependencies from "extras" and then from "groups".

### Changed

- Passing no extras to an environment now defaults to no added extras or groups.
Old behavior (to default to the extra with the same name as the environment)
was lead to complications with support of `dependency-groups`. Explicitly pass
the extra or group if to get the old behavior.
- `default_envs` now passed the environment name as `extras_or_groups`.
Therefore, if the name of the environment is an extra, it will be used.
Otherwise, it will be from a group of that name.

- Removed option `--base/--no-base`. Replaced with `--skip-package`. Default is
to include package dependencies. Pass `--skip-package` (or
`skip_package = true` in `pyproject.toml`) to skip package dependencies.

## v0.11.0 — 2023-11-28

### Added
Expand Down
Loading

0 comments on commit 3f379da

Please sign in to comment.