Skip to content

Commit

Permalink
chore: update cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
wpk-nist-gov committed Feb 11, 2025
1 parent 0eacb25 commit 14868f1
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 193 deletions.
4 changes: 2 additions & 2 deletions .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": "fcf6a1b310af2e6b051bae186dbdd5be5d9bf229",
"commit": "ce1bec36acf76cc95cb3f865f059b8804fea4b7a",
"checkout": "develop",
"context": {
"cookiecutter": {
Expand All @@ -19,7 +19,7 @@
"__answers": "",
"_copy_without_render": [],
"_template": "https://github.com/usnistgov/cookiecutter-nist-python.git",
"_commit": "fcf6a1b310af2e6b051bae186dbdd5be5d9bf229"
"_commit": "ce1bec36acf76cc95cb3f865f059b8804fea4b7a"
}
},
"directory": null
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ repos:
# * uv
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.5.29
rev: 0.5.30
hooks:
- id: uv-lock
args: [--locked]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ $ conda/condax install -c conda-forge pyproject2conda

[rich]: https://github.com/Textualize/rich
[shellingham]: https://github.com/sarugaku/shellingham
[typer]: https://github.com/tiangolo/typer
[typer]: https://github.com/fastapi/typer

If using pip, to install with [rich] and [shellingham] support, either install
them your self, or use:
Expand Down
36 changes: 13 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,19 @@
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
# "IPython.sphinxext.ipython_directive",
# "IPython.sphinxext.ipython_console_highlighting",
# "nbsphinx",
# - easier external links
# "sphinx.ext.extlinks",
# - view source code on created page
# "sphinx.ext.viewcode",
# - view source code on github
"sphinx.ext.linkcode",
# - add copy button
"sphinx_copybutton",
# - redirect stuff?
# "sphinxext.rediraffe",
# - pretty things up?
# "sphinx_design"
# - myst stuff
# "myst_nb",
"myst_parser",
"sphinx_click",
]

nitpicky = True
autosectionlabel_prefix_document = True
nitpicky = True
suppress_warnings = ["autosectionlabel.*"]
nitpick_ignore = [
("py:class", "Command"),
("py:class", "typer.core.TyperGroup"),
]

# -- myst stuff ---------------------------------------------------------
myst_enable_extensions = [
Expand Down Expand Up @@ -265,7 +255,7 @@ def _get_version() -> str:
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -418,12 +408,12 @@ def _get_ipython_savefig_dir() -> str:
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"numpy": ("https://numpy.org/doc/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"numba": ("https://numba.readthedocs.io/en/stable/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
# "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
# "numpy": ("https://numpy.org/doc/stable", None),
# "scipy": ("https://docs.scipy.org/doc/scipy/", None),
# "numba": ("https://numba.readthedocs.io/en/stable/", None),
# "matplotlib": ("https://matplotlib.org/stable/", None),
# "xarray": ("https://docs.xarray.dev/en/stable/", None),
}

linkcheck_ignore = ["https://doi.org/"]
Expand Down
9 changes: 0 additions & 9 deletions docs/examples/index.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
```{toctree}
:maxdepth: 1
<!-- example -->
installation
<!-- examples/index -->
reference/index
license
contributing
Expand Down
66 changes: 35 additions & 31 deletions requirements/lock/py312-uvxrun-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,34 +235,38 @@ crashtest==0.3.1 \
--hash=sha256:300f4b0825f57688b47b6d70c6a31de33512eb2fa1ac614f780939aa0cf91680 \
--hash=sha256:42ca7b6ce88b6c7433e2ce47ea884e91ec93104a4b754998be498a8e6c3d37dd
# via clikit, conda-lock
cryptography==44.0.0 ; sys_platform == 'linux' \
--hash=sha256:1923cb251c04be85eec9fda837661c67c1049063305d6be5721643c22dd4e2b7 \
--hash=sha256:37d76e6863da3774cd9db5b409a9ecfd2c71c981c38788d3fcfaf177f447b731 \
--hash=sha256:3c672a53c0fb4725a29c303be906d3c1fa99c32f58abe008a82705f9ee96f40b \
--hash=sha256:404fdc66ee5f83a1388be54300ae978b2efd538018de18556dde92575e05defc \
--hash=sha256:4ac4c9f37eba52cb6fbeaf5b59c152ea976726b865bd4cf87883a7e7006cc543 \
--hash=sha256:62901fb618f74d7d81bf408c8719e9ec14d863086efe4185afd07c352aee1d2c \
--hash=sha256:660cb7312a08bc38be15b696462fa7cc7cd85c3ed9c576e81f4dc4d8b2b31591 \
--hash=sha256:708ee5f1bafe76d041b53a4f95eb28cdeb8d18da17e597d46d7833ee59b97ede \
--hash=sha256:761817a3377ef15ac23cd7834715081791d4ec77f9297ee694ca1ee9c2c7e5eb \
--hash=sha256:831c3c4d0774e488fdc83a1923b49b9957d33287de923d58ebd3cec47a0ae43f \
--hash=sha256:84111ad4ff3f6253820e6d3e58be2cc2a00adb29335d4cacb5ab4d4d34f2a123 \
--hash=sha256:8b3e6eae66cf54701ee7d9c83c30ac0a1e3fa17be486033000f2a73a12ab507c \
--hash=sha256:9e6fc8a08e116fb7c7dd1f040074c9d7b51d74a8ea40d4df2fc7aa08b76b9e6c \
--hash=sha256:a01956ddfa0a6790d594f5b34fc1bfa6098aca434696a03cfdbe469b8ed79285 \
--hash=sha256:abc998e0c0eee3c8a1904221d3f67dcfa76422b23620173e28c11d3e626c21bd \
--hash=sha256:b15492a11f9e1b62ba9d73c210e2416724633167de94607ec6069ef724fad092 \
--hash=sha256:be4ce505894d15d5c5037167ffb7f0ae90b7be6f2a98f9a5c3442395501c32fa \
--hash=sha256:c5eb858beed7835e5ad1faba59e865109f3e52b3783b9ac21e7e47dc5554e289 \
--hash=sha256:cd4e834f340b4293430701e772ec543b0fbe6c2dea510a5286fe0acabe153a02 \
--hash=sha256:d2436114e46b36d00f8b72ff57e598978b37399d2786fd39793c36c6d5cb1c64 \
--hash=sha256:eb33480f1bad5b78233b0ad3e1b0be21e8ef1da745d8d2aecbb20671658b9053 \
--hash=sha256:eca27345e1214d1b9f9490d200f9db5a874479be914199194e746c893788d417 \
--hash=sha256:ed3534eb1090483c96178fcb0f8893719d96d5274dfde98aa6add34614e97c8e \
--hash=sha256:f3f6fdfa89ee2d9d496e2c087cebef9d4fcbb0ad63c40e821b39f74bf48d9c5e \
--hash=sha256:f53c2c87e0fb4b0c00fa9571082a057e37690a8f12233306161c8f4b819960b7 \
--hash=sha256:f5e7cb1e5e56ca0933b4873c0220a78b773b24d40d186b6738080b73d3d0a756 \
--hash=sha256:f677e1268c4e23420c3acade68fac427fffcb8d19d7df95ed7ad17cdef8404f4
cryptography==44.0.1 ; sys_platform == 'linux' \
--hash=sha256:00918d859aa4e57db8299607086f793fa7813ae2ff5a4637e318a25ef82730f7 \
--hash=sha256:1e8d181e90a777b63f3f0caa836844a1182f1f265687fac2115fcf245f5fbec3 \
--hash=sha256:1f9a92144fa0c877117e9748c74501bea842f93d21ee00b0cf922846d9d0b183 \
--hash=sha256:21377472ca4ada2906bc313168c9dc7b1d7ca417b63c1c3011d0c74b7de9ae69 \
--hash=sha256:24979e9f2040c953a94bf3c6782e67795a4c260734e5264dceea65c8f4bae64a \
--hash=sha256:2a46a89ad3e6176223b632056f321bc7de36b9f9b93b2cc1cccf935a3849dc62 \
--hash=sha256:322eb03ecc62784536bc173f1483e76747aafeb69c8728df48537eb431cd1911 \
--hash=sha256:436df4f203482f41aad60ed1813811ac4ab102765ecae7a2bbb1dbb66dcff5a7 \
--hash=sha256:4f422e8c6a28cf8b7f883eb790695d6d45b0c385a2583073f3cec434cc705e1a \
--hash=sha256:53f23339864b617a3dfc2b0ac8d5c432625c80014c25caac9082314e9de56f41 \
--hash=sha256:5fed5cd6102bb4eb843e3315d2bf25fede494509bddadb81e03a859c1bc17b83 \
--hash=sha256:610a83540765a8d8ce0f351ce42e26e53e1f774a6efb71eb1b41eb01d01c3d12 \
--hash=sha256:6c8acf6f3d1f47acb2248ec3ea261171a671f3d9428e34ad0357148d492c7864 \
--hash=sha256:6f76fdd6fd048576a04c5210d53aa04ca34d2ed63336d4abd306d0cbe298fddf \
--hash=sha256:72198e2b5925155497a5a3e8c216c7fb3e64c16ccee11f0e7da272fa93b35c4c \
--hash=sha256:887143b9ff6bad2b7570da75a7fe8bbf5f65276365ac259a5d2d5147a73775f2 \
--hash=sha256:888fcc3fce0c888785a4876ca55f9f43787f4c5c1cc1e2e0da71ad481ff82c5b \
--hash=sha256:8e6a85a93d0642bd774460a86513c5d9d80b5c002ca9693e63f6e540f1815ed0 \
--hash=sha256:94f99f2b943b354a5b6307d7e8d19f5c423a794462bde2bf310c770ba052b1c4 \
--hash=sha256:9b336599e2cb77b1008cb2ac264b290803ec5e8e89d618a5e978ff5eb6f715d9 \
--hash=sha256:a2d8a7045e1ab9b9f803f0d9531ead85f90c5f2859e653b61497228b18452008 \
--hash=sha256:b8272f257cf1cbd3f2e120f14c68bff2b6bdfcc157fafdee84a1b795efd72862 \
--hash=sha256:bf688f615c29bfe9dfc44312ca470989279f0e94bb9f631f85e3459af8efc009 \
--hash=sha256:d9c5b9f698a83c8bd71e0f4d3f9f839ef244798e5ffe96febfa9714717db7af7 \
--hash=sha256:dd7c7e2d71d908dc0f8d2027e1604102140d84b155e658c20e8ad1304317691f \
--hash=sha256:df978682c1504fc93b3209de21aeabf2375cb1571d4e61907b3e7a2540e83026 \
--hash=sha256:e403f7f766ded778ecdb790da786b418a9f2394f36e8cc8b796cc056ab05f44f \
--hash=sha256:eb3889330f2a4a148abead555399ec9a32b13b7c8ba969b72d8e500eb7ef84cd \
--hash=sha256:f4daefc971c2d1f82f03097dc6f216744a6cd2ac0f04c68fb935ea2ba2a0d420 \
--hash=sha256:f51f5705ab27898afda1aaa430f34ad90dc117421057782022edf0600bec5f14 \
--hash=sha256:fd0ee90072861e276b0ff08bd627abec29e32a53b2be44e41dbcdf87cbee2b00
# via secretstorage
decorator==5.1.1 \
--hash=sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330 \
Expand Down Expand Up @@ -1066,9 +1070,9 @@ urllib3==1.26.20 \
--hash=sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e \
--hash=sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32
# via conda-lock, requests, twine
virtualenv==20.29.1 \
--hash=sha256:4e4cb403c0b0da39e13b46b1b2476e505cb0046b25f242bee80f62bf990b2779 \
--hash=sha256:b8b8970138d32fb606192cb97f6cd4bb644fa486be9308fb9b63f81091b5dc35
virtualenv==20.29.2 \
--hash=sha256:fdaabebf6d03b5ba83ae0a02cfe96f48a716f4fae556461d180825866f75b728 \
--hash=sha256:febddfc3d1ea571bdb1dc0f98d7b45d24def7428214d4fb73cc486c9568cce6a
# via conda-lock, pre-commit
wcwidth==0.2.13 \
--hash=sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859 \
Expand Down
60 changes: 16 additions & 44 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,23 @@ ignore = [
"D105", # - Missing magic method docstring
"D107", # - Missing docstring in __init__
"D203", # - 1 blank line required before class docstring
"D205", # - blank line after summary
"D212", # - Multi-line docstring summary should start at the first line
"D400", # - First line should end with a period
"D401", # - First line of docstring should be in imperative mood: "{first_line}"
"DOC201", # - Missing return from documentation
"DOC501", # - Missing raises from documentation
"E501", # - line too long - let formatter fix this
"E731", # - do not assign a lambda expression, use a def
"FBT", # - bools are ok
"S404", # - Want to use subprocess sometimes
"S603", # - subprocess-without-shell-equals-true
"S607", # - start-process-with-partial-path
"PLC0415", # - import should be at top level (leads to issues with imports in func?)
"TID252", # - Allow relative imports
]
# Use extend-ignore for project specific ignores (avoid changing ignore directly)
extend-ignore = [
# "ANN", # - Annotations (just use mypy/pyright)
# "D102", # - Missing docstring in public method
# "D103", # - Missing docstring in public function
# "D202", # - blank line after docstring
"D205", # - blank line after summary
"D400", # - First line should end with a period
"D401", # - First line of docstring should be in imperative mood: "{first_line}"
# "D415", # - First line should end with a period, question mark, or exclamation point
# "D417", # - Missing argument description in the docstring for {definition}: {name} (bad with docfiller)
"DOC201", # - Missing return from documentation
"DOC501", # - Missing raises from documentation
# "DOC202", # - Missing return from documentation
# "E402", # - module level import not at top of file
# "ERA", # - eradicate (want to keep some stuff)
# "ISC", # - flake8-implicit-str-concat
"NPY", # - not using numpy?
# "SLF001", # - flake8-self (private access sometimes OK)
"PD", # - not using pandas?
# "PLR2004", # - numbers in comparison sometimes ok
# "PLR0913", # - complexity sometimes ok
# "PLR0917", # - complexity sometimes ok
]
# Use extend-ignore for project specific ignores. Prefer lint.extend-per-file-ignores."src/**/*.py" below
# extend-ignore = [ ]
isort.known-first-party = [
"pyproject2conda",
]
Expand All @@ -75,36 +61,22 @@ pylint.max-positional-args = 15
pylint.max-public-methods = 30

[lint.per-file-ignores]
"**/*.ipynb" = [
"B018",
"D100",
"INP001",
]
"docs/conf.py" = [
"ERA",
"INP001",
"ERA", # - Some helpful commented out code in conf.py
"INP001", # - Namespace package fine for docs
]
"noxfile.py" = [
"RUF009",
"RUF009", # - Allow `add_option` for DataClassParser
]
"tests/*.py" = [
"D",
"S101",
]
"tools/*.py" = [
"A",
"D102",
"DOC402",
"S",
"SLF001",
"D", # - Don't need to document tests
"S101", # - Assert is fine with tests
]

# Project specific ignores (avoid changing per-file-ignores directly)
# extend-per-file-ignores."path/to/file.py" = [ ... ]
[lint.extend-per-file-ignores]
"**/cli.py" = [
# "ARG001",
# "D102",
"FA100",
"PLR0913",
"PLR0917",
Expand All @@ -117,5 +89,5 @@ pylint.max-public-methods = 30
"PT011",
]
"tools/cog_utils.py" = [
"D",
"D103",
]
10 changes: 5 additions & 5 deletions src/pyproject2conda/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def wrapped(*args: Any, **kwargs: Any) -> R:
@add_verbose_logger(logger)
def create_list(
filename: PYPROJECT_CLI = DEFAULT_TOML_PATH,
# verbose: VERBOSE_CLI = None, # noqa: ERA001
verbose: VERBOSE_CLI = None, # noqa: ARG001
) -> None:
"""List available extras."""
logger.info("filename: %s", filename)
Expand Down Expand Up @@ -563,7 +563,7 @@ def yaml(
header: HEADER_CLI = None,
custom_command: CUSTOM_COMMAND_CLI = None,
overwrite: OVERWRITE_CLI = Overwrite.force,
# verbose: VERBOSE_CLI = None, # noqa: ERA001
verbose: VERBOSE_CLI = None, # noqa: ARG001
deps: DEPS_CLI = None,
reqs: REQS_CLI = None,
allow_empty: Annotated[bool, ALLOW_EMPTY_OPTION] = False,
Expand Down Expand Up @@ -625,7 +625,7 @@ def requirements(
header: HEADER_CLI = None,
custom_command: CUSTOM_COMMAND_CLI = None,
overwrite: OVERWRITE_CLI = Overwrite.force,
# verbose: VERBOSE_CLI = None, # noqa: ERA001
verbose: VERBOSE_CLI = None, # noqa: ARG001
reqs: REQS_CLI = None,
allow_empty: Annotated[bool, ALLOW_EMPTY_OPTION] = False,
remove_whitespace: Annotated[bool, REMOVE_WHITESPACE_OPTION] = False,
Expand Down Expand Up @@ -759,7 +759,7 @@ def conda_requirements(
# paths,
deps: DEPS_CLI = None,
reqs: REQS_CLI = None,
# verbose: VERBOSE_CLI = None, # noqa: ERA001
verbose: VERBOSE_CLI = None, # noqa: ARG001
) -> None:
"""
Create requirement files for conda and pip.
Expand Down Expand Up @@ -830,7 +830,7 @@ def to_json(
skip_package: SKIP_PACKAGE_CLI = False,
deps: DEPS_CLI = None,
reqs: REQS_CLI = None,
# verbose: VERBOSE_CLI = None, # noqa: ERA001
verbose: VERBOSE_CLI = None, # noqa: ARG001
overwrite: OVERWRITE_CLI = Overwrite.force,
) -> None:
"""
Expand Down
10 changes: 5 additions & 5 deletions tools/dataclass_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ def factory(
const: Any = UNDEFINED,
default: Any | None = UNDEFINED,
dest: str = UNDEFINED,
help: str = UNDEFINED,
help: str = UNDEFINED, # noqa: A002
metavar: str = UNDEFINED,
nargs: str | int | None = UNDEFINED,
required: bool = UNDEFINED,
type: Callable[[Any], Any] = UNDEFINED,
type: Callable[[Any], Any] = UNDEFINED, # noqa: A002
) -> Self:
"""Factory method."""
return cls(
Expand Down Expand Up @@ -187,11 +187,11 @@ def add_option(
choices: Container[Any] = UNDEFINED,
const: Any = UNDEFINED,
dest: str = UNDEFINED,
help: str = UNDEFINED,
help: str = UNDEFINED, # noqa: A002
metavar: str = UNDEFINED,
nargs: str | int | None = UNDEFINED,
required: bool = UNDEFINED,
type: Callable[[Any], Any] = UNDEFINED,
type: Callable[[Any], Any] = UNDEFINED, # noqa: A002
**field_kws: Any, # noqa: ARG001
) -> Any:
"""Add option."""
Expand Down Expand Up @@ -268,7 +268,7 @@ def _get_dataclass_annotations_and_options(
) -> dict[str, tuple[Any, Option]]:
annotations = get_type_hints(cls, include_extras=True)

assert is_dataclass(cls)
assert is_dataclass(cls) # noqa: S101
cls_fields = fields(cls)

out: dict[str, tuple[Any, Any]] = {}
Expand Down
2 changes: 1 addition & 1 deletion tools/noxtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def write_hashes(hash_path: str | Path, hashes: dict[str, Any]) -> None:
def _get_file_hash(path: str | Path, buff_size: int = 65536) -> str:
import hashlib

md5 = hashlib.md5()
md5 = hashlib.md5() # noqa: S324
with Path(path).open("rb") as f:
while data := f.read(buff_size): # pylint: disable=while-used
md5.update(data)
Expand Down
Loading

0 comments on commit 14868f1

Please sign in to comment.