Skip to content

Commit

Permalink
chore: update cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
wpk committed Jan 30, 2024
1 parent 3d04290 commit 44ef5bb
Show file tree
Hide file tree
Showing 21 changed files with 258 additions and 245 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": "88c234d5a8d5a0c71c08bde51be21abb83bc09aa",
"commit": "5c831aacaf85f4a0025a66074fd34fd056da7b22",
"checkout": "develop",
"context": {
"cookiecutter": {
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ like to install them in the development environment instead, use the

Additional tools are:

- [pip-tools]
- [pre-commit]
- [scriv]
- [nbqa]
Expand All @@ -515,7 +514,6 @@ Additional tools are:
These are setup using the following:

```console
condax/pipx install pip-tools
condax/pipx install pre-commit
pipx install scriv
condax/pipx install nbqa
Expand Down
13 changes: 11 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class SessionParams(DataclassParser):
)
pip_compile_opts: OPT_TYPE = add_option(help="options to pip-compile")
pip_compile_run: RUN_ANNO = None
pip_compile_run_internal: RUN_ANNO = None

# test
test_no_pytest: bool = False
Expand Down Expand Up @@ -459,11 +460,15 @@ def create_lock(path: Path) -> None:

@nox.session(name="pip-compile", **ALL_KWS)
@add_opts
def pip_compile(
def pip_compile( # noqa: C901
session: Session,
opts: SessionParams,
) -> None:
"""Run pip-compile."""
"""Run pip-compile.
Note that this session is also used to run pip-sync with correct python version for
tests/typing/etc.
"""
runner = Installer(
session=session,
pip_deps=["pip-tools"],
Expand All @@ -475,6 +480,10 @@ def pip_compile(
runner.run_commands(opts.pip_compile_run)
return

if opts.pip_compile_run_internal:
runner.run_commands(opts.pip_compile_run_internal, external=False)
return

options = opts.pip_compile_opts or []

force = (
Expand Down
37 changes: 20 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ test = [
"pytest-xdist",
]
tools = [
"pip-tools",
"pre-commit",
"pyright",
"scriv",
Expand Down Expand Up @@ -119,7 +118,6 @@ fragments = [
[tool.ruff]
fix = true
line-length = 88
# Handle notebooks as well
extend-include = ["*.ipynb"]
extend-exclude = [
".venv",
Expand All @@ -133,26 +131,16 @@ unsafe-fixes = true
# use nbqa for ruff linting
preview = true
select = ["ALL"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
# fixable = ["A", "B", "C", "D", "E", "F", "..."]
# fixable = ["ALL"]
# unfixable = []
# Exclude a variety of commonly ignored directories.
ignore = [
"PD", # - not using pandas?
"NPY", # - not using numpy?
"CPY", # - Don't require copyright
"ERA", # - eradicate (want to keep some stuff)
"FBT", # - bools are ok
# * Annotations
# "SLF001", # - flake8-self (private access sometimes OK)
# "ANN", # - Annotations (just use mypy/pyright)
"ANN101", # - Leads to issues with methods and self
"ANN102", # - Leads to issues with classmethods and cls
"ANN401", # - Any ok sometimes
# * pylint
# "PLR2004", # - numbers in comparison sometimes ok
# "PLR0913", # - complexity sometimes ok
# "PLR0917", # - complexity sometimes ok
# * Allow non top level imports
"PLC0415", # - import should be at top level (leads to issues with imports in func?)
"TID252", # - Allow relative imports
Expand All @@ -164,13 +152,10 @@ ignore = [
"D105", # - Missing magic method docstring
"D205", # - blank line after summary
# * This leads to errors with placing titles in module
# "D102", # - Missing docstring in public method
# "D103", # - Missing docstring in public function
"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
# * Not a fan of these. And lead to issues with docfiller
# "D202", # - blank line after docstring
"D107", # - Missing docstring in __init__
"D203", # - 1 blank line required before class docstring
"D212", # - Multi-line docstring summary should start at the first line
Expand All @@ -181,6 +166,23 @@ ignore = [
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Use extend-ignore for project specific ignores (avoid changing ignore directly)
extend-ignore = [
"PD", # - not using pandas?
"NPY", # - not using numpy?
# * Annotations
# "SLF001", # - flake8-self (private access sometimes OK)
# "ANN", # - Annotations (just use mypy/pyright)
# * pylint
# "PLR2004", # - numbers in comparison sometimes ok
# "PLR0913", # - complexity sometimes ok
# "PLR0917", # - complexity sometimes ok
# * Docstrings ymmv
# "D102", # - Missing docstring in public method
# "D103", # - Missing docstring in public function
# "D202", # - blank line after docstring
]


[tool.ruff.lint.pydocstyle]
convention = "numpy"
Expand All @@ -192,12 +194,13 @@ max-public-methods = 30

[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = ["INP001"]
"tests/*.py" = ["D", "S101"]
"noxfile.py" = ["RUF009"]
"tools/*.py" = ["S", "A", "SLF001"]
"tests/*.py" = ["D", "S101"]
"**/*.ipynb" = ["D100", "B018", "INP001"]

[tool.ruff.lint.extend-per-file-ignores]
# Project specific ignores (avoid changing per-file-ignores directly)
"tests/*.py" = ["ANN", "PT011", "PLC2701", "PLR2004"]
"**/cli.py" = ["FA100", "ARG001", "T201", "PLR0913", "PLR0917", "D102"]
"tools/cog_utils.py" = ["D"]
Expand Down
1 change: 0 additions & 1 deletion requirements/dev-complete.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ipython
mypy>=1.4.1
nox
packaging
pip-tools
pre-commit
pyright
pytest
Expand Down
26 changes: 13 additions & 13 deletions requirements/lock/py310-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --output-file=./requirements/lock/py310-test.txt ./requirements/test.txt
# pip-compile --allow-unsafe --output-file=requirements/lock/py310-test.txt --strip-extras requirements/test.txt
#
click==8.1.7
# via typer
coverage[toml]==7.3.2
coverage==7.4.1
# via
# coverage
# pytest-cov
Expand All @@ -18,33 +18,33 @@ iniconfig==2.0.0
# via pytest
packaging==23.2
# via
# -r ./requirements/test.txt
# -r requirements/test.txt
# pytest
# pytest-sugar
pluggy==1.3.0
pluggy==1.4.0
# via pytest
pytest==7.4.3
pytest==8.0.0
# via
# -r ./requirements/test.txt
# -r requirements/test.txt
# pytest-cov
# pytest-sugar
# pytest-xdist
pytest-cov==4.1.0
# via -r ./requirements/test.txt
# via -r requirements/test.txt
pytest-sugar==0.9.7
# via -r ./requirements/test.txt
# via -r requirements/test.txt
pytest-xdist==3.5.0
# via -r ./requirements/test.txt
# via -r requirements/test.txt
termcolor==2.4.0
# via pytest-sugar
tomli==2.0.1
# via
# -r ./requirements/test.txt
# -r requirements/test.txt
# coverage
# pytest
tomlkit==0.12.3
# via -r ./requirements/test.txt
# via -r requirements/test.txt
typer==0.9.0
# via -r ./requirements/test.txt
typing-extensions==4.8.0
# via -r requirements/test.txt
typing-extensions==4.9.0
# via typer
18 changes: 9 additions & 9 deletions requirements/lock/py310-typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile --allow-unsafe --output-file=requirements/lock/py310-typing.txt --strip-extras requirements/typing.txt
#
attrs==23.1.0
attrs==23.2.0
# via pytype
click==8.1.7
# via typer
Expand All @@ -14,13 +14,13 @@ importlab==0.8.1
# via pytype
iniconfig==2.0.0
# via pytest
jinja2==3.1.2
jinja2==3.1.3
# via pytype
libcst==1.1.0
# via pytype
markupsafe==2.1.3
markupsafe==2.1.4
# via jinja2
mypy==1.7.1
mypy==1.8.0
# via -r requirements/typing.txt
mypy-extensions==1.0.0
# via
Expand All @@ -36,17 +36,17 @@ packaging==23.2
# via
# -r requirements/typing.txt
# pytest
pluggy==1.3.0
pluggy==1.4.0
# via pytest
pycnite==2023.10.11
# via pytype
pydot==1.4.2
pydot==2.0.0
# via pytype
pyparsing==3.1.1
# via pydot
pytest==7.4.3
pytest==8.0.0
# via -r requirements/typing.txt
pytype==2023.11.29 ; python_version < "3.11"
pytype==2024.1.24 ; python_version < "3.11"
# via -r requirements/typing.txt
pyyaml==6.0.1
# via libcst
Expand All @@ -65,7 +65,7 @@ typer==0.9.0
# via -r requirements/typing.txt
types-click==7.1.8
# via -r requirements/typing.txt
typing-extensions==4.8.0
typing-extensions==4.9.0
# via
# libcst
# mypy
Expand Down
Loading

0 comments on commit 44ef5bb

Please sign in to comment.