Releases: usethis-python/usethis-python
v0.14.1
🐞 Bug Fixes
- The
usethis show sonarqube
command, which is currently undocumented and should be considered experimental, did not properly print to the console. This has been fixed.
📚 Documentation
- The
simple-modern-uv
template is now mentioned in the README. See https://github.com/jlevy/simple-modern-uv.
🔧 Internal Changes
-
The
urllib3
package version for development was bumped from 2.3.0 to 2.5.0 to address CVE-2025-50181 and CVE-2025-50182. -
pydantic
is no longer imported for initializing the Typer application, which should provide a small performance improvement in some situations, like when using the--help
flag. -
Pyright for development now uses the
nodejs
extra, which is recommended in the Pyright docs.
What's Changed
- Bump
urllib3
to address CVE-2025-50181 and CVE-2025-50182 by @nathanjmcdougall in #772 - Try to improve load speed by deferring imports at the interface layer by @nathanjmcdougall in #773
- Add
usethis --help
benchmark by @nathanjmcdougall in #776 - Convert UsethisConfig to a dataclass to avoid importing
pydantic
at… by @nathanjmcdougall in #779 - Add the nodejs extra for pyright, as suggested by pyright for Python … by @nathanjmcdougall in #781
- Add
simple-modern-uv
to "Similar Projects" section of README.md by @nathanjmcdougall in #783 - Add and test missing print functionality for
usethis show sonarqube
by @nathanjmcdougall in #785 - Add changelog by @nathanjmcdougall in #786
Full Changelog: v0.14.0...v0.14.1
v0.14.0
🚀 New Features
-
A new
usethis status
command is provided to set the Development Status classifiers for the project. -
The uv link mode is now set to
symlink
by default, which can avoid issues for Windows developers relating to access permissions. See here for more information. -
The
usethis tool ruff
command now accepts--no-formatter
and--no-linter
flags to opt-out of adding the formatter or linter, respectively. Previously, this behaviour was implicit in the use of the use or non-use of the--formatter
and--linter
flags, but now it is explicit. -
Google-style docstrings are now the default in
usethis docstyle
. It remains opt-in tousethis init
. -
usethis readme
,usethis init
andusethis badge
now treat emptyREADME.md
files as suitable for populating with sensible default content, similar to as if the file did not exist. -
When using Import Linter, a message explaining that
__init__.py
files are required is now printed to the console if the user attempts to use Import Linter without Ruff. The message isn't necessary when using Ruff, since the INP rules are selected to enforce the presence of__init__.py
files. -
Codespell configuration now includes the
ignore-words-list
option (set to empty) by default for whitelisted words. This should make it easier to get started with Codespell, since there are often a few false positives in a codebase.
🦾 Robustness
- File validation errors (e.g. an invalid
.pre-commit-config.yaml
file) will no longer dump the full stack trace to the console. Instead, a more concise, user-friendly error message is displayed.
🐞 Bug Fixes
-
Previously, the INP Ruff rules were enabled when using Import Linter, but this is incorrect behaviour for the
tests
directory, sincepytest
does not require__init__.py
files in thetests
directory, and Import Linter does not need to analyze it. The INP rules are now ignored for thetests
directory when being added for Import Linter. -
The
uv export
command was configured to use--no-dev
, whereas it should exclude all dependency groups using the--no-default-groups
option, which is the new behaviour. -
The
usethis readme
command would create apyproject.toml
file, if it did not already exist. This is not necessary and this behaviour has been removed. -
The
usethis tool pre-commit
command would not adapt its message explaining how to manually install pre-commit hooks based on whether the user was using uv or not. This has been fixed.
🔧 Internal Changes
-
usethis has been moved from the
nathanjmcdougall
GitHub user to theusethis-python
organization. -
The codspeed Walltime runner is now used for CI benchmarks.
-
Configuration is now available internally to turn off the possibility of subprocessing uv. This is work towards support for non-uv based workflows, e.g. for users who use Poetry.
What's Changed
- Remove distracting
usethis init
path argument in README.md by @nathanjmcdougall in #744 - Change default flag behaviour for usethis tool ruff to use standard b… by @nathanjmcdougall in #745
- Set Google as the default docstyle by @nathanjmcdougall in #746
- Better document why we add/supplement existing config by @nathanjmcdougall in #747
- Update GitHub uris to reflect new repo home for usethis by @nathanjmcdougall in #748
- Remove inconsistent full stops in GitHub Issue template
about
field by @nathanjmcdougall in #752 - Use codpseed-macro for codspeed benchark job in CI by @nathanjmcdougall in #729
- Don't create
pyproject.toml
viaadd_readme
by @nathanjmcdougall in #751 - Remove trace references to old repo location by @nathanjmcdougall in #754
- Print message to use
__init__.py
when using Import Linter without ruff by @nathanjmcdougall in #753 - Bugfix/ignore inp rules for tests dir by @nathanjmcdougall in #757
- Add to empty README files in add_readme by @nathanjmcdougall in #749
- Set the uv link mode to symlink by default by @nathanjmcdougall in #760
- Add global state to raise an error when attempting to subprocess uv by @nathanjmcdougall in #763
- Generalize frozen pre-commit install instruction for uv users by @nathanjmcdougall in #762
- Use
--no-default-groups
in preference to--no-dev
by @nathanjmcdougall in #765 - 766 include ignore words list config by default for codespell by @nathanjmcdougall in #767
- Don't dump full stack trace when there are file validation errors by @nathanjmcdougall in #768
- 122 a way to set lifecycle development status by @nathanjmcdougall in #769
- Add changelog for v0.14.0 by @nathanjmcdougall in #771
Full Changelog: v0.13.0...v0.14.0
v0.13.0
🚀 New Features
-
New high-level interfaces have been added:
usethis init
to initialize projects including recommended tools, andusethis lint
,usethis format
,usethis spellcheck
, andusethis test
to add sets of recommended tools for different purposes. For example,usethis lint
will add both Ruff and deptry. As recommended tooling changes in the long-term, these commands will remain the same but potentially change the specific tools they include. -
Error messages are now directed to stderr instead of stdout.
-
The
INP
code Ruff rules are now enabled when adding Import Linter, since Import Linter requires__init__.py
files to exist in the packages it analyzes. -
The
usethis docstyle
possible arguments (numpy
,google
, andpep257
) are now handled in a way that should lead to more readable error messages and--help
explanations.
🦾 Robustness
-
If
pre-commit install
does not run successfully (e.g. if there is not Git Repository for the project) then usethis will display a message for the user to ask them to run this command themselves, rather than the previous behaviour which was to stop with an error. -
Syntax errors in TOML and INI configuration files will be handled when trying to determine whether a given tool is being used. A warning is displayed but usethis will continue under the assumption that the invalid file does not contain relevant configuration for the tool.
🐞 Bug Fixes
-
Previously, when calling
usethis tool ruff --how
, any passed--linter
or--formatter
arguments would be ignored and instructions would be displayed for both the linter and the formatter regardless. This is no longer the case - now if either the--linter
or--formatter
argument is passed, just the specified arguments will be considered in terms of the messages displayed. -
Previously, when adding pre-commit hook definitions, it was possible to duplicate the added definition if there was a duplicate hook ID existing in the file. This has been fixed. Similarly, when adding pre-commit hooks definitions, the intended order of hooks was violated in some circumstances. The ordering logic has been reworked to ensure consistent hook ordering (based on the hook ID).
-
Previously, when adding
pre-commit
, ifpyproject-fmt
orcodespell
were present, the default configuration would be added for those tools too. This is no longer the case - addingpre-commit
will not touch the existing configuration for other tools except for the way in which they are installed and declared as dependencies. -
Previously, the
usethis rule
command did not handle some error messages properly, and would dump the full stack trace. This has been resolved.
📦 Packaging
- The
typer
dependency lower bound has been bumped from version 0.6.0 to 0.12.4 to provide support for union types of Enum withNone
.
📚 Documentation
-
More information has been added to the README in the Command Line Interface Table of Contents, giving a one-line summary of each command.
-
The GitHub Issue templates have been simplified down to make them more accessible.
🔧 Internal Changes
-
The test suite on CI now runs on the lowest supported version of uv (0.5.29), rather than just the latest version.
-
The
ARG
Ruff rules are now enabled for development of usethis. -
New
alert_only
global state has been added to allow the suppression of non-warning and non-error printing to the console. -
New global state has been added to set the project directory (versus the previous default of using the current working directory in all cases).
-
The
requests
package version for development was bumped from 2.23.3 to 2.23.4 to address CVE-2024-47081.
What's Changed
- Test pre-commit integrations more explicitly for Bitbucket pipelines by @nathanjmcdougall in #686
- Add INP rules when using Import Linter by @nathanjmcdougall in #685
- Simplify GitHub issue templates by @nathanjmcdougall in #689
- Use stderr for error output instead of stdout by @nathanjmcdougall in #687
- Implement
usethis lint
by @nathanjmcdougall in #691 - Cope with syntax errors in TOML and INI files in is_used with appropr… by @nathanjmcdougall in #688
- Implement
usethis format
by @nathanjmcdougall in #694 - Implement
usethis spellcheck
by @nathanjmcdougall in #697 - Implement
usethis test
by @nathanjmcdougall in #698 - Add higher-level toolset-adding commands to CLI index in README by @nathanjmcdougall in #700
- Add more detail to README.md by @nathanjmcdougall in #702
- Simplify whitespace in pre-commit JSON schema to sync with schema store by @nathanjmcdougall in #713
- Add toolset module for bundles of tools e.g. use_linters for Ruff and… by @nathanjmcdougall in #710
- Put the Manage Tooling command definitions in alphabetical order by @nathanjmcdougall in #711
- Handle failed pre-commit install via box message by @nathanjmcdougall in #714
- Ensure all interfaces are protected with try-except by @nathanjmcdougall in #709
- Use docstyle Enum at interface level by @nathanjmcdougall in #712
- Fix a bug where adding pre-commit would modify the config for some to… by @nathanjmcdougall in #715
- Fix bug where usethis spellcheck ignores --remove and --how by @nathanjmcdougall in #719
- Enable ARG Ruff rules for development by @nathanjmcdougall in #720
- Remove unused pytest fixtures and enable ARG002 for test suite by @nathanjmcdougall in #721
- Bump requests to address CVE-2024-47081 for dev by @nathanjmcdougall in #722
- Put uv version onto the CI matrix to test on earlier version of uv by @nathanjmcdougall in #724
- Use bullet-points consistently in changelog by @nathanjmcdougall in #725
- Respect
--linter
and--formatter
inusethis tool ruff --how
by @nathanjmcdougall in #727 - Correctly order pre-commit hooks when no precedents are added yet by @nathanjmcdougall in #731
- 732 insert repo will add duplicate repos if precedent ids are duplicated by @nathanjmcdougall in #734
- Add
alert_only
as a global state configuration by @nathanjmcdougall in #736 - Use global state to determine the project directory by @nathanjmcdougall in #739
- 307 implement usethis init by @nathanjmcdougall in #741
- Update CHANGELOG.md for version 0.13.0 by @nathanjmcdougall in #743
Full Changelog: v0.12.0...v0.13.0
0.12.0
🚀 New Features
-
The Ruff linter and formatter can now be configured independently. When using the
usethis tool ruff
command, you can now specify whether to add or remove the linter or formatter independently using the--linter
and--formatter
options. This allows for more granular control over which components of Ruff are used in your project. By default, as before, both the linter and formatter will be added or removed together.
This introduces a change in the way that Bitbucket Pipeline steps will be configured for Ruff, by having the linter and formatter as separate steps. -
Integrations with Ruff for pre-commit and Bitbucket pipelines will determine whether the linter or formatter is being used based on the presence of the
ruff.lint
andruff.format
keys the active Ruff configuration file.
🐞 Bug Fixes
-
The
usethis tool
command no longer creates apyproject.toml
file when using the--remove
option. -
The Coverage.py tool was previously referred to as simply "coverage" in the codebase and documentation. This has been corrected to Coverage.py, which is the official name of the tool.
-
The RegEx used to parse the Python versions outputted by
uv python list
has been tightened to avoid matching invalid versions containing non-alphanumeric leading characters.
📦 Packaging
- The
click
package is no longer constrained to!=8.2.0
, since the latest version of Typer (0.16.0) is compatible withclick
8.2.0.
📚 Documentation
-
The README now explains that
usethis tool
commands will create apyproject.toml
file if it does not already exist (to be able to declare dependencies). -
A security policy has been added in
SECURITY.md
.
🔧 Internal Changes
-
A
requirements.txt
file is now included in the repository (generated using the uv lockfile and automatically updated via pre-commit). This allows for Dependabot scanning. Accordingly, the version ofh11
in the lockfile was bumped to address a security issue (CVE-2025-43859). -
CodeQL is now configured for security scanning.
-
Previously, all pre-commit hooks ran post-checkout, post-merge, and post-rewrite. Now, only
uv-sync
will run for those stages, the rest will run only on pre-commit. This is to avoid unnecessary overhead when checking out branches or merging, etc. -
Some stricter linting configuration has been added for Ruff.
-
Permissions are now set explicitly for the GitHub Actions workflows used for development.
What's Changed
- Add requirements.txt for dependabot by @nathanjmcdougall in #597
- Bump h11 for development to address CVE-2025-43859 by @nathanjmcdougall in #628
- Better document behaviour regarding
pyproject.toml
creation in `use… by @nathanjmcdougall in #629 - Set CI permissions explicitly for GitHub CI Workflow by @nathanjmcdougall in #634
- Replace \d+ with \d{1,2} in regex by @nathanjmcdougall in #636
- Tighten regex range from [A-z] to [A-Za-z] in _parse_python_version_f… by @nathanjmcdougall in #633
- Rename coverage to Coverage.py by @nathanjmcdougall in #631
- Rename coverage to Coverage.py in README.md by @nathanjmcdougall in #637
- 630 dont create pyprojecttoml in usethis tool with remove by @nathanjmcdougall in #641
- Sort tests alphabetically in tests\usethis_core\test_core_tool.py by @nathanjmcdougall in #647
- Only run pre-commits on post-checkout, post-merge, and post-rewrite f… by @nathanjmcdougall in #648
- Create codeql.yml by @nathanjmcdougall in #649
- 639 move testpyprojecttomltool out of test core toolpy by @nathanjmcdougall in #650
- Second attempt - only run pre-commits on post-checkout, post-merge, a… by @nathanjmcdougall in #651
- Introduce new
is_config_present
helper function inTool
abc by @nathanjmcdougall in #652 - Fix invalid access in codeql file and ignore on doc-only changes by @nathanjmcdougall in #653
- Run codspeed in its own matrix entry for GitHub actions by @nathanjmcdougall in #656
- Add security policy by @nathanjmcdougall in #657
- Typo fix in SECURITY.md by @nathanjmcdougall in #659
- Enable flake8-bandit rules and comply with them by @nathanjmcdougall in #658
- Use consistent formatting of usethis in README by @nathanjmcdougall in #661
- Improve docstring and comments for src\usethis_core\tool.py:use_ruff by @nathanjmcdougall in #664
- Add args section to
use_ruff
docstring since it has additional argu… by @nathanjmcdougall in #666 - 642 enable tool.ruff.format.docstring code format true by default by @nathanjmcdougall in #668
- Add stricter configuration for
lint.flake8-type-checking
and move m… by @nathanjmcdougall in #669 - Restore pre-commit checks to CI by @nathanjmcdougall in #670
- Minor: Reuse
RuffTool()
viatool
variable rather than re-initiali… by @nathanjmcdougall in #671 - Add a heuristic to determine whether the Ruff linter is being used. by @nathanjmcdougall in #674
- 673 implement a heuristic to detect whether the ruff formatter is used by @nathanjmcdougall in #675
- Move
UseToolFunc
tosrc\usethis\_core\tool.py
and add docstring by @nathanjmcdougall in #676 - Remove version prohibition on click by @nathanjmcdougall in #677
- Swap order of ruff and ruff-format pre-commits for dev by @nathanjmcdougall in #679
- Allow independent inclusion of the ruff linter and formatter by @nathanjmcdougall in #580
Full Changelog: v0.11.0...v0.12.0
0.11.0
🚀 New Features
-
This release adds a new
--show
option to theusethis badge
interface. This option will display the badge as markdown output without adding it to the README file. -
The latest version of the Bitbucket Pipelines configuration file schema is now supported, specifically support for new options available regarding artifact uploads.
🐞 Bug Fixes
-
The
--quiet
option did not properly suppress output when displaying warnings associated with failed README parsing inusethis badge
. This has been fixed. -
Due to a breaking change in Click v8.2.0, Click is now declared as a direct dependency temporarily until the ramifications can be addressed in Typer. The lower bound is declared as
>=8.0.0
and the constraint!=8.2.0
to avoid the breaking change. For more information, see here.
📚 Documentation
- There have been various improvements to the documentation, especially the contribution guide.
🔧 Internal Changes
- Minor improvements to the CI configuration have been made; the CI will no longer trigger for changes to markdown files only, and
--break-system-packages
is no longer used.
What's Changed
- Add Commits since latest release badge by @nathanjmcdougall in #600
- Add more detailed instructions for running in isolation by @nathanjmcdougall in #601
- Delete docs/lessons.md by @nathanjmcdougall in #607
- Explain need for extra guidance for some issues by @nathanjmcdougall in #608
- Update bitbucket schema by @nathanjmcdougall in #613
- Try removing
--break-system-packages
in ci.yml by @nathanjmcdougall in #612 - Add a --show flag for usethis badge by @Z-Fran in #605
- Don't trigger CI for changes to markdown files only by @nathanjmcdougall in #615
- 610 never use simple print by @nathanjmcdougall in #614
- Add some information about writing tests to
CONTRIBUTING.md
by @nathanjmcdougall in #616 - Document
jaraco/skeleton
as a template alternative by @nathanjmcdougall in #617 - Explain pre-commit in CONTRIBUTING.md by @nathanjmcdougall in #618
- Add more hyperlinks and examples to the README by @nathanjmcdougall in #620
- Document
usethis badge --show
by @nathanjmcdougall in #626 - Add exclusion on click dependency by @nathanjmcdougall in #625
- Add changelog for v0.11.0 by @nathanjmcdougall in #627
New Contributors
Full Changelog: v0.10.0...v0.11.0
0.10.0
What's Changed
- 311 implement a rule management interface by @nathanjmcdougall in #540
- Create .readthedocs.yaml by @nathanjmcdougall in #584
- Add documentation requirements.txt file for readthedocs by @nathanjmcdougall in #585
- Point ReadTheDocs to the requirements file by @nathanjmcdougall in #586
- Sync README with CLI help docs by @nathanjmcdougall in #587
- Update docstring in _vary_network_conn by @nathanjmcdougall in #588
- Add informal development roadmap to README by @nathanjmcdougall in #589
- Don't add
--showlocals
by default forpytest
by @nathanjmcdougall in #591 - Create
CONTRIBUTING.md
by @nathanjmcdougall in #592 - Move to Alpha development status by @nathanjmcdougall in #594
- Add changelog by @nathanjmcdougall in #595
- 437 add a how flag for tools by @nathanjmcdougall in #593
- Bump Jinja2 as per dependabot CVE-2025-27516 by @nathanjmcdougall in #598
- Add disclaimer about the experimental nature of updating existing projects by @nathanjmcdougall in #599
Full Changelog: v0.9.3...v0.10.0
0.9.3
What's Changed
- Fix typo in docstring in _tool.py by @nathanjmcdougall in #566
- Add
TypeAlias
for rules by @nathanjmcdougall in #567 - Create a unified RuleConfig abstraction by @nathanjmcdougall in #569
- Disable install completions by @nathanjmcdougall in #570
- Add rich help panels to CLI by @nathanjmcdougall in #572
- Refactor
_tool.py
into separate modules by @nathanjmcdougall in #573 - Fix incorrect toml_document variable name by @nathanjmcdougall in #577
- 558 usethis tool coverage breaks existing config in some cases by @nathanjmcdougall in #560
Full Changelog: v0.9.2...v0.9.3
0.9.2
What's Changed
- Update ci.yml by @nathanjmcdougall in #334
- Revert "Update ci.yml (#334)" by @nathanjmcdougall in #556
- Correctly document edge case for "first" resolution strategy where pr… by @nathanjmcdougall in #548
- Implement correct resolution strategy for codespell by @nathanjmcdougall in #547
Full Changelog: v0.9.1...v0.9.2
0.9.1
What's Changed
- Update README.md with
usethis tool import-linter
by @nathanjmcdougall in #530 - Test codespell message isn't duplicated. by @nathanjmcdougall in #531
- Enable the fly rule by default by @nathanjmcdougall in #533
- Remove header in usethis list by @nathanjmcdougall in #532
- Disclaim that
uv
is relied on in some cases in README by @nathanjmcdougall in #536 - Add pythonpath config to pytest if necessary by @nathanjmcdougall in #534
- Add support for
uv.toml
by @nathanjmcdougall in #538 - Disable EM rule by @nathanjmcdougall in #539
Full Changelog: v0.9.0...v0.9.1
0.9.0
What's Changed
- 98 implement usethis tool import linter by @nathanjmcdougall in #528
Full Changelog: v0.8.1...v0.9.0