Releases: usethis-python/usethis-python
v0.17.0
🚀 New Features
-
The
usethis ci bitbucketcommand will now automatically use parallelism between pipeline steps where possible. -
The
usethis ci bitbucketcommand now has a--no-matrix-pythonoption to opt-out of generating a Python version matrix for CI pipelines, i.e. to only test against a single Python version. -
The behaviour of
--backend=noneis now the default when Poetry is detected, and a warning is displayed. This would change in a future release when a Poetry backend is implemented. -
The command
usethis badge sockethas been added, which adds a Socket badge to the README for your PyPI package, giving a security scan rating.
🐞 Bug Fixes
-
usethis tool import-linterwill no longer addINPrules multiple times when run repeatedly. -
The (undocumented)
usethis show sonarqubecommand previously gave invalid config for flat directory structures; this has been fixed. Also, the command no longer creates apyproject.tomlfile if it does not already exist. -
When running
usethis tool requirements.txtwith--backend=none, the how-to-use message misleadingly implies that a pre-existingrequirements.txtfile would be modified; this message no longer displays in this case.
🦾 Robustness
-
Unrecognized entries (i.e. not found in the JSON Schema Store) in
.pre-commit-config.yamlandbitbucket-pipelines.ymlfiles will no longer cause validation errors or be dropped. Other minor improvements to the schema validation logic have also been made to improve robustness when roundtripping files. -
Read-only operations on YAML files will no longer modify the file with cosmetic changes. There should also be a small performance improvement associated with avoiding unnecessary writes.
-
The
usethis ci bitbucketcommand will add thepre-commitcache topre-commitsteps when using the--backend=nonebehaviour. -
Running
usethis initwith--backend=nonewill now explicitly instruct the user about any dependencies that need to be managed manually. -
References to Bitbucket Pipelines are now consistently capitalized and pluralized throughout the codebase.
📚 Documentation
-
The FAQ now explicitly explains whether
uvis necessary to useusethis, and gives some guidance for Poetry users. -
Instructions for implementing a new
usethis badgecommand in usethis have been added to the CONTRIBUTING.md file. -
Some instructions for how to diagnose slow
pytestcollection speeds are now inCONTRIBUTING.md. -
There is now an acknowledgements section in the README.
-
The
CONTRIBUTING.mdfile now explains how to run the CLI from within a temporary project directory. -
The
CONTRIBUTING.mdfile explicitly mentions that type annotations should not be included in docstrings. -
The
CONTRIBUTING.mdfile now explains the details of theusethis._config.usethis_configglobal state object. -
All
usethis toolcommands are now explicitly enumerated in the README. -
The README now explicitly links to the ReadTheDocs site.
-
The CLI Reference had issues with indentation of sub-bullet points; this has been resolved.
-
A few badges have been moved and added to the Development section of the README.
📦 Packaging
- As per the notes for 0.16.0, Version 0.18.13 of
ruamel.yamlintroduced a regression relating to indentation. The new version 0.18.16 ofruamel.yamlis now also excluded as a dependency version until this is addressed in a future release.
🔧 Internal Changes
-
There is now a method
Tool.default_command()to specify any CLI command associated with a tool, to reduce duplication across the codebase. -
The
tytype checker from Astral has been added, and now runs via pre-commit hooks. Pyright continues to be used in the CI, but not via pre-commit. -
The
zizmorCI runner no longer triggers for documentation-only changes. -
There is now a
copilot-instructions.mdfile to configure GitHub Copilot. -
The test to ensure the docs stay synchronized with the README has been weakened and no longer hard-codes any content from the README. This should reduce the flakiness of this test for README-only changes.
What's Changed
- Move badges down the README.md (#1030) by @nathanjmcdougall in #1031
- Forbid ruamel.yaml v0.18.16 and update README test to pass CI by @nathanjmcdougall in #1040
- Don't duplicate ignored rules matching glob by @nathanjmcdougall in #1042
- Fix print-how-to-use for requirements.txt with none backend by @nathanjmcdougall in #1043
- Add Ruff badge to development section of the README by @nathanjmcdougall in #1046
- Don't create pyproject.toml if it does not exist when showing SonarQu… by @nathanjmcdougall in #1048
- Add a read-only context manager for YAML files to prevent round-trip … by @nathanjmcdougall in #1047
- 1027 omissions in messages for usethis init backend=none by @nathanjmcdougall in #1049
- Explicitly document the
ruamel.yamldependency constraints in the 0… by @nathanjmcdougall in #1052 - Allow extra fields in YAML schema modules, add stricter validation by @nathanjmcdougall in #1050
- Add some documentation about whether uv is necessary by @nathanjmcdougall in #1054
- Add some instructions for diagnosing slow test collection speeds by @nathanjmcdougall in #1055
- Fix sub-bullet point markdown formatting in CLI reference by @nathanjmcdougall in #1057
- Ignore doc-only changes when triggering zizmor scanning by @nathanjmcdougall in #1056
- Explicitly link to the ReadTheDocs site from the README by @nathanjmcdougall in #1058
- Add explicit guidance for poetry users in FAQ by @nathanjmcdougall in #1060
- Support parallel step insertion and parallelism breakup in Bitbucket pipelines by @Copilot in #1051
- Add support for detecting poetry projects automatically and using the… by @nathanjmcdougall in #1059
- Explicitly mention all
usethis toolinterfaces in the README by @nathanjmcdougall in #1061 - Use consistent capitalization of bitbucket pipelines by @nathanjmcdougall in #1067
- Fix whitespace and grammar by @nathanjmcdougall in #1068
- Add acknowledgements section by @nathanjmcdougall in #1066
- Fix pluralization of
*_bitbucket_pipelines_configfunctions by @nathanjmcdougall in #1072 - Refactor the
src\usethis\_core\ci.pymodule by @nathanjmcdougall in #1073 - Fix Bitbucket pipelines capitalization/pluralization in docstrings by @nathanjmcdougall in #1074
- Weaken the README sync test to reduce content duplication by @nathanjmcdougall in #1083
- Tweak wording in README by @nathanjmcdougall in #1076
- Document how to add new badge implementations by @nathanjmcdougall in #1081
- 1063 usethis badge socket by @nathanjmcdougall in #1080
- Add CLI-level test for import pipeline error handling in Bitbucket integration by @Copilot in #1085
- Add copilot instructions file, improve CONTRIBUTING.md detail. by @nathanjmcdougall in #1087
- Migrate to Ruff 0.14.3 by @nathanjmcdougall in #1094
- Document test side-effect prevention guidelines by @Copilot in #1096
- Document usethis_config global state management by @Copilot in #1100
- Add Tool.default_command() to eliminate duplication in CI steps and help messages by @Copilot in #1088
- Fix SonarQube double indexing in flat layout by excluding tests from sources by @Copilot in #1091
- Disable
PLR0913in the interface layer by @nathanjmcdougall in #1105 - Add --matrix-python/--no-matrix-python flag to opt out of CI matrices by @Copilot in #1089
- Add helper methods to
get_sonar_project_propertiesby @nathanjmcdougall in #1107 json.schemastore.org->www.schemastore.orgby @nathanjmcdougall in #1109- Add
pre-commitcache to Bitbucket pipeline ste...
0.16.0
0.16.0
🚀 New Features
-
Most commands now accept a
--backendoption to specify the package manager backend to use. Up to this point,uvwas the only supported backend. Now, a--backend=noneoption is available to use usethis withoutuv. This is a step toward supporting other backends such as Poetry in the future. When unspecified, heuristics will be used to determine the backend. -
The use of
pyproject.tomlin a project is no longer assumed or imposed on a project when not using theuvbackend. -
pre-commitconfigurations are now more conventional, preferring URL-based repo configuration instead of local repos withlanguage: system. The previous behaviour was designed to ensure synchronization of versions between theuvlockfile and thepre-commitconfiguration, but this is now provided by thesync-with-uvpre-commit hook, which is added automatically when usingpre-commitwithuv. -
When using
usethis author, a message with the author's name is now outputted in the console.
🦾 Robustness
-
Pydantic warnings relating to deprecated access to the
model_fieldsattribute on an instance should no longer occur. -
The
tool.deptry.ignore_notebooksconfiguration for deptry is set explicitly to the default value offalseto hint that deptry is being used, and to hint on how to configure it.
🐞 Bug Fixes
-
Previously, the
usethis ci bitbucketcommand would fail to add Import Linter configuration to the CI pipeline whenimport-linterwas detected. This has been fixed. -
The
usethis badge pypicommand would generate markdown with invalid syntax due to a stray<character. This has been fixed.
🧹 Maintenance
-
The default version of
pyproject-fmtwhen used as a pre-commit has been bumped from v2.6.0 to v2.11.0. -
The latest version of the Bitbucket Pipelines configuration file schema is now supported, specifically inline and custom pipeline step types; the
input_variablesconfiguration for steps, and the new namescopedfor the artifacts upload type optionunshared.
📚 Documentation
-
Hyperlinks in the README and CONTRIBUTING.md files now point to the stable documentation site (rather than the latest site).
-
The configurator project is now documented as a similar project in the README.
📦 Packaging
-
Python 3.14 is now formally supported.
-
clickis no longer a direct dependency. -
Version 0.18.13 of
ruamel.yamlintroduced a regression relating to indentation. This version, along with 0.18.14 and 0.18.15, are now excluded as dependency versions to avoid this issue until it is addressed in a future release.
🔧 Internal Changes
-
The CI configuration has been overhauled.
uvis used in more conventional ways. A runner has been added for bleeding edge dependency versions. The CI now runs on a cron schedule.zizmorhas been added for security scanning. Permissions are more tightly scoped and explained. All actions have been bumped to their latest versions. -
The pre-commit hooks have been migrated to use
prekrather thanpre-commitfor development. -
pytest-sugarhas been added for a more user-friendly test suite output, andpytest-emojihas been removed.
What's Changed
- Fix typo in docstring of
Tool.get_install_methodby @nathanjmcdougall in #917 - Change hyperlinks to point to stable docs by @nathanjmcdougall in #918
- Bump bitbucket pipelines schema by @nathanjmcdougall in #926
- Remove stray brace in
get_pypi_badgeby @nathanjmcdougall in #925 - Display a message when setting an author with
add_authorby @nathanjmcdougall in #927 - Include error handling when trying to set UTF-8 outputs by @nathanjmcdougall in #928
- Add
--backendflag to over-ride manual detection of uv by @nathanjmcdougall in #826 - Update codecov badge token by @nathanjmcdougall in #931
- Bump Bitbucket pipelines schema to support custom steps and both inli… by @nathanjmcdougall in #940
- Only use
pyproject.tomlfor config when it already exists by @nathanjmcdougall in #934 - Bump pyproject-fmt to v2.7.0 by @nathanjmcdougall in #955
- Add support for the
input-variablesstep field in BitBucket pipelines by @nathanjmcdougall in #956 - Pass CI on uv 0.9.0 (Python 3.14) by @nathanjmcdougall in #961
- Avoid accessing model_fields on an instance in
fancy_model_dumpand… by @nathanjmcdougall in #964 - Declare Python 3.14 support by @nathanjmcdougall in #959
- Use
uv syncto set up dependencies inci.yamlby @nathanjmcdougall in #876 - Add CI runner for bleeding edge versions, refactor matrix configuration by @nathanjmcdougall in #965
- Migrate from
pre-committoprekby @nathanjmcdougall in #969 - Comply with
zizmorby @nathanjmcdougall in #971 - Add
pytest-sugarfor dev by @nathanjmcdougall in #974 - Configure cron schedule for CI by @nathanjmcdougall in #975
- Add
sync-with-uvand use more conventional pre-commit config by @nathanjmcdougall in #978 - Ensure Import Linter is added via
use_ci_bitbucketby @nathanjmcdougall in #988 - Enable max-deps CI worker on PRs by @nathanjmcdougall in #993
- Document
configuratoras a similar project by @nathanjmcdougall in #998 - Bump GitHub action versions by @nathanjmcdougall in #996
- Set
[tool.deptry.ignore_notebooks]explicitly asdeptryconfig by @nathanjmcdougall in #989 - 909 make bitbucket ci config backend agnostic by @nathanjmcdougall in #953
- Use
python-versionin setup-uv GitHub action and Consolidate CI steps by @nathanjmcdougall in #999 - Remove
pytest-emojiby @nathanjmcdougall in #1001 - Add
sync-with-uvfor repos usingpre-commitwithuvby @nathanjmcdougall in #1005 - Broaden exception handling in
test_matches_schema_storetests by @nathanjmcdougall in #1009 - Add
zizmorGitHub actions config by @nathanjmcdougall in #1007 - Remove unnecessary
contents: readpermissions by @nathanjmcdougall in #1019 - Move to standard pre-commit configuration where possible by @nathanjmcdougall in #1017
- 502 if uv isnt used dont add a pre commit config relying on uv by @nathanjmcdougall in #1023
- Add changelog for v0.16.0 by @nathanjmcdougall in #1025
Full Changelog: v0.15.2...v0.16.0
0.15.2
🦾 Robustness
- Previously, empty
.pre-commit-config.yamlfiles would cause errors, (since they are not considered valid by pre-commit). Now usethis will treat them as if they do not exist, and so will write new config to them if applicable, rather than raising a validation error for this case.
🐞 Bug Fixes
-
When subprocessing
uv, theusethis initcommand will no longer use the default for--build-backend, and instead will always explicitly usehatch. This may change in the future if the default supported build backend forusethisbecomesuv_build, which is the new default foruvv0.8.0. This change avoids creating broken config which mixesuv_buildwithhatchconfig. -
When adding Import Linter while using Ruff, the
INPrules are selected, but ignored for the tests directory. However, no message would be displayed in cases where those rules were already selected but not already ignored. Now, a message will be displayed in this case.
📚 Documentation
-
A documentation site is now available at https://usethis.readthedocs.io/en/stable/. The CLI Reference section has been moved there from the README. Other minor wording and clarity improvements have been made.
-
The CLI reference now mentions that
usethis tool pre-commitwill install hooks to Git.
🔧 Internal Changes
- The
docdependency group is no longer a default group. This reduces the dependencies required on CI.
What's Changed
- Reword changelog for v0.15.1 by @nathanjmcdougall in #873
- Rename
ensure_file_manager_existstoensure_managed_file_existsby @nathanjmcdougall in #872 - Use
uv syncto set up dependencies inci.yamlby @nathanjmcdougall in #874 - Revert "Use
uv syncto set up dependencies inci.yaml" by @nathanjmcdougall in #875 - Remove nested parenthesis in README by @nathanjmcdougall in #877
- Reword description of
usethis cito clarify there is no recommended… by @nathanjmcdougall in #878 - Mention that
usethis testincludes Coverage.py by @nathanjmcdougall in #879 - Remove idempotent encode-decode calls for unicode character by @nathanjmcdougall in #882
- 881 usethis tool import linter doesnt give message for ignoring inp by @nathanjmcdougall in #885
- Configure some tests to run offline by @nathanjmcdougall in #890
- Don't use
docgroup in testing CI by @nathanjmcdougall in #896 - Mention that
usethis tool pre-commitwill install hooks in the docs by @nathanjmcdougall in #899 - Break the README into docs pages, remove the CLI ref from the README by @nathanjmcdougall in #898
- Always use
--build-backend hatchforuv initsubprocesses from `u… by @nathanjmcdougall in #901 - Update
faq.mdfor grammar by @nathanjmcdougall in #903 - Support empty
.pre-commit-config.yaml filesby @nathanjmcdougall in #906 - Add changelog for v0.15.2 by @nathanjmcdougall in #914
Full Changelog: v0.15.1...v0.15.2
0.15.1
🐞 Bug Fixes
-
Previously, when using Import Linter with Ruff, the
INPrule would be ignored in thetestsdirectory via an incorrect glob pattern of"*/tests/**"; this has been fixed to"tests/**". -
A TOML integration problem could cause broken configuration in some cases. This could occur on deeply nested keys, such as the per-file-ignores for Ruff directories in
pyproject.tomlwhen using Import Linter. This has now been fixed.
📚 Documentation
-
Some issues with mismatched bullet points in the CLI docs section of the README have been addressed.
-
The opening paragraph of the README has been reworded for clarity, and various other minor changes have been made.
🔧 Internal Changes
- Changes to the
CIand the test suite have been made to supportuvv0.8.0. Newer features ofuvare now required in the CI configuration, meaning the lowest tested version ofuvis now v0.6.8. Going forward, it is not recommended to use older versions ofuvwithusethis.
What's Changed
- Fix mismatched bullet points in README.md by @nathanjmcdougall in #858
- Fix bullet-point mismatch in README by @nathanjmcdougall in #857
- Clarify opening paragraph in README by @nathanjmcdougall in #859
- Grammar in
Manage the READMEvs.Manage READMEby @nathanjmcdougall in #860 - Implement
Dependency.to_requirements_stringby @nathanjmcdougall in #861 - For Import Linter, Fix INP config glob pattern, add its config when a… by @nathanjmcdougall in #864
- Support
uvv0.8.0 by @nathanjmcdougall in #867 - Update guidance on checking
uvversion to reflect change to `uv sel… by @nathanjmcdougall in #868 - Don't break Ruff TOML config when adding Import Linter by @nathanjmcdougall in #865
- Add changelog for v0.15.1 by @nathanjmcdougall in #871
Full Changelog: v0.15.0...v0.15.1
0.15.0
🚀 New Features
-
The
usethis tool mkdocscommand has been implemented to manage MkDocs documentation sites. Also, the higher-levelusethis doccommand has been added, which has the same effect. -
The
--docoption forusethis inithas been implemented to initialize MkDocs documentation sites by default. The old behaviour can be restored by passing--no-doc. -
Coverage.py for measuring test coverage is now included by default when using
usethis testorusethis initwith the default--testoption. This provides out-of-the-box test coverage reporting. -
The
--frozenoption is now supported in theusethis ciandusethis docstylecommands. Similar to other commands, this will leave the virtual environment and lockfile unchanged. -
The
--offlineoption is now supported in theusethis docstylecommand. This will run the command without network access.
🦾 Robustness
- Incorrectly structured TOML files will emit better messages and in some cases will be handled gracefully, specifically in cases where a non-mapping value is encountered where a mapping is expected.
📦 Packaging
- Bounds are now placed on the build dependencies for usethis (i.e.
hatch-vcs>=0.5.0,<0.6.0andhatchling>=1.27.0,<1.28.0), which should improve reproducibility of builds in the long run.
🔧 Internal Changes
-
A
YAMLFileManagerhas been implemented to manage YAML files, which is used for the MkDocs configuration filemkdocs.yml. -
A new
get_project_depsmethod has been added to retrieve core project dependencies from thepyproject.tomlfile, specifically from theproject.dependenciessection. This will be used in a future release to support non-uv based backends, such as Poetry.
What's Changed
- Set bounds on build requirements by @nathanjmcdougall in #841
- Include Coverage.py as a default recommended test framework tool as a… by @nathanjmcdougall in #835
- 837 handle unexpected non mappings better in toml files by @nathanjmcdougall in #840
- 827 implement a yamlfilemanager by @nathanjmcdougall in #833
- Support
--frozeninusethis ciby @nathanjmcdougall in #845 - Support
--offlineand--frozeninusethis docstyleby @nathanjmcdougall in #846 - Bump pyright from v1.1.399 -> v1.1.403 by @nathanjmcdougall in #848
- Implement
get_project_depsand tests by @nathanjmcdougall in #853 - Update
ConfigEntrydocstring to sync with attributes by @nathanjmcdougall in #852 - Implement
usethis tool mkdocsby @nathanjmcdougall in #823 - Implement
usethis docandusethis init --docby @nathanjmcdougall in #854 - Changelog/0.15.0 by @nathanjmcdougall in #855
Full Changelog: v0.14.2...v0.15.0
0.14.2
🦾 Robustness
-
The heuristics to determine whether a tool is used will now check the
pre-commitconfiguration to see whether there is apre-commithook for the tool. -
When removing an entry of TOML configuration, usethis makes some effort to remove empty tables and sections. This was previously only done to one level of nesting, but it should now occur at multiple levels of nesting.
🐞 Bug Fixes
-
The Codespell configuration for
pyproject.tomlwas giving invalid configuration for theignore-words-listoption, which was set to an empty list. Codespell requires this option to be non-empty. It is now set to["..."], which is consistent with the handling for other INI-based configuration files. -
Previously, using the
--howoption forusethis toolcommands would not properly infer the way a tool was installed. For example, it would assume that a tool is installed as a pre-commit hook, simply becausepre-commitwas used for the project, without checking whether there actually are any hooks. This has been fixed, and more sophisticated heuristics are now used to determine how a tool is installed. -
The message to suggest using
__init__.pyfiles when using Import Linter now checks explicitly whether you have theINPrules enabled in Ruff, rather than simply assuming that these rules would be enabled when Ruff is used. The message is only displayed if theseINPrules are not enabled. -
Error messages now use more consistent punctuation and formatting.
🧹 Maintenance
-
The default version of
pyproject-fmtwhen used as a pre-commit has been bumped from v2.5.0 to v2.6.0. -
The latest version of the Bitbucket Pipelines configuration file schema is now supported, specifically support for new options available regarding concurrency groups.
📚 Documentation
-
The FAQ is now included in the MkDocs build, and information about roundtripping is now included in the FAQ.
-
Social Icon buttons for GitHub and PyPI have been added to the bottom of the MkDocs site.
🔧 Internal Changes
-
Minor improvements to the CI configuration have been made; the CI will no longer trigger for changes to the MkDocs configuration files.
-
There is now global state to turn off pre-commit detection for pre-commit integrations, which is a step toward providing an interface to forbid adding a tool as a pre-commit.
-
In the previous release, the project moved to using the codspeed Walltime runner for CI benchmarks. This has been reverted back to using the GitHub-based codspeed runners, since the Walltime runner reports were not as detailed and there were usage limits.
What's Changed
- Move
roundtrip.mdtofaq.mdby @nathanjmcdougall in #789 - Break up long sentence in README blurb by @nathanjmcdougall in #794
- Bump Bitbucket pipelines schema: Add support for concurrency groups a… by @nathanjmcdougall in #797
- Don't trigger CI when mkdocs config changes by @nathanjmcdougall in #796
- 792 dont trigger ci for changes to mkdocs config by @nathanjmcdougall in #798
- Add FAQ to mkdocs config by @nathanjmcdougall in #791
- Bump the pyproject-fmt version to v2.6.0 from v2.5.0 Test that hard-… by @nathanjmcdougall in #799
- Add test that pre-commit hooks actually runs successfully when adding… by @nathanjmcdougall in #800
- Add global state to turn off pre-commit detection for pre-commit inte… by @nathanjmcdougall in #803
- Check runner.invoke has run successfully in tests by @nathanjmcdougall in #553
- Add social (GitHub, PyPI) icon links to mkdocs config by @nathanjmcdougall in #806
- Add
is_declared_as_depto functionalize checking whether a tool's c… by @nathanjmcdougall in #810 - 802 print how to use could give misleading message regarding pre commit by @nathanjmcdougall in #812
- Catch broader FileConfigError rather than FileDecodeError in is_used by @nathanjmcdougall in #816
- Update
print_how_to_usefor all tools to use new `get_install_metho… by @nathanjmcdougall in #814 - Check whether a pre-commit hook is used as a part of
is_usedheuris… by @nathanjmcdougall in #813 - Revert back to using GitHub-based codspeed runners instead of codspee… by @nathanjmcdougall in #820
- For Import linter, suggest init.py files when INP rules are not s… by @nathanjmcdougall in #821
- Improve error string formatting for consistency by @nathanjmcdougall in #818
- Tidy up cleanup logic for empty TOML sections by @nathanjmcdougall in #830
- Don't use empty ignore-words-list in pyproject.toml config for Codespell by @nathanjmcdougall in #832
- Changelog/0.14.2 by @nathanjmcdougall in #836
Full Changelog: v0.14.1...v0.14.2
0.14.1
🐞 Bug Fixes
- The
usethis show sonarqubecommand, which is currently undocumented and should be considered experimental, did not properly print to the console. This has been fixed.
📚 Documentation
- The
simple-modern-uvtemplate is now mentioned in the README. See https://github.com/jlevy/simple-modern-uv.
🔧 Internal Changes
-
The
urllib3package version for development was bumped from 2.3.0 to 2.5.0 to address CVE-2025-50181 and CVE-2025-50182. -
pydanticis no longer imported for initializing the Typer application, which should provide a small performance improvement in some situations, like when using the--helpflag. -
Pyright for development now uses the
nodejsextra, which is recommended in the Pyright docs.
What's Changed
- Bump
urllib3to 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 --helpbenchmark by @nathanjmcdougall in #776 - Convert UsethisConfig to a dataclass to avoid importing
pydanticat… by @nathanjmcdougall in #779 - Add the nodejs extra for pyright, as suggested by pyright for Python … by @nathanjmcdougall in #781
- Add
simple-modern-uvto "Similar Projects" section of README.md by @nathanjmcdougall in #783 - Add and test missing print functionality for
usethis show sonarqubeby @nathanjmcdougall in #785 - Add changelog by @nathanjmcdougall in #786
Full Changelog: v0.14.0...v0.14.1
0.14.0
🚀 New Features
-
A new
usethis statuscommand is provided to set the Development Status classifiers for the project. -
The uv link mode is now set to
symlinkby default, which can avoid issues for Windows developers relating to access permissions. See here for more information. -
The
usethis tool ruffcommand now accepts--no-formatterand--no-linterflags 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--formatterand--linterflags, but now it is explicit. -
Google-style docstrings are now the default in
usethis docstyle. It remains opt-in tousethis init. -
usethis readme,usethis initandusethis badgenow treat emptyREADME.mdfiles 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__.pyfiles 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__.pyfiles. -
Codespell configuration now includes the
ignore-words-listoption (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.yamlfile) 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
testsdirectory, sincepytestdoes not require__init__.pyfiles in thetestsdirectory, and Import Linter does not need to analyze it. The INP rules are now ignored for thetestsdirectory when being added for Import Linter. -
The
uv exportcommand was configured to use--no-dev, whereas it should exclude all dependency groups using the--no-default-groupsoption, which is the new behaviour. -
The
usethis readmecommand would create apyproject.tomlfile, if it did not already exist. This is not necessary and this behaviour has been removed. -
The
usethis tool pre-commitcommand 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
nathanjmcdougallGitHub user to theusethis-pythonorganization. -
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 initpath 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
aboutfield by @nathanjmcdougall in #752 - Use codpseed-macro for codspeed benchark job in CI by @nathanjmcdougall in #729
- Don't create
pyproject.tomlviaadd_readmeby @nathanjmcdougall in #751 - Remove trace references to old repo location by @nathanjmcdougall in #754
- Print message to use
__init__.pywhen 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-groupsin preference to--no-devby @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
0.13.0
🚀 New Features
-
New high-level interfaces have been added:
usethis initto initialize projects including recommended tools, andusethis lint,usethis format,usethis spellcheck, andusethis testto add sets of recommended tools for different purposes. For example,usethis lintwill 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
INPcode Ruff rules are now enabled when adding Import Linter, since Import Linter requires__init__.pyfiles to exist in the packages it analyzes. -
The
usethis docstylepossible arguments (numpy,google, andpep257) are now handled in a way that should lead to more readable error messages and--helpexplanations.
🦾 Robustness
-
If
pre-commit installdoes 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--linteror--formatterarguments 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--linteror--formatterargument 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-fmtorcodespellwere present, the default configuration would be added for those tools too. This is no longer the case - addingpre-commitwill not touch the existing configuration for other tools except for the way in which they are installed and declared as dependencies. -
Previously, the
usethis rulecommand did not handle some error messages properly, and would dump the full stack trace. This has been resolved.
📦 Packaging
- The
typerdependency 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
ARGRuff rules are now enabled for development of usethis. -
New
alert_onlyglobal 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
requestspackage 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 lintby @nathanjmcdougall in #691 - Cope with syntax errors in TOML and INI files in is_used with appropr… by @nathanjmcdougall in #688
- Implement
usethis formatby @nathanjmcdougall in #694 - Implement
usethis spellcheckby @nathanjmcdougall in #697 - Implement
usethis testby @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
--linterand--formatterinusethis tool ruff --howby @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_onlyas 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 ruffcommand, you can now specify whether to add or remove the linter or formatter independently using the--linterand--formatteroptions. 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 Pipelines 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.lintandruff.formatkeys the active Ruff configuration file.
🐞 Bug Fixes
-
The
usethis toolcommand no longer creates apyproject.tomlfile when using the--removeoption. -
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 listhas been tightened to avoid matching invalid versions containing non-alphanumeric leading characters.
📦 Packaging
- The
clickpackage is no longer constrained to!=8.2.0, since the latest version of Typer (0.16.0) is compatible withclick8.2.0.
📚 Documentation
-
The README now explains that
usethis toolcommands will create apyproject.tomlfile 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.txtfile 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 ofh11in 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-syncwill 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.tomlcreation 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_presenthelper function inToolabc 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_ruffdocstring 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-checkingand move m… by @nathanjmcdougall in #669 - Restore pre-commit checks to CI by @nathanjmcdougall in #670
- Minor: Reuse
RuffTool()viatoolvariable 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
UseToolFunctosrc\usethis\_core\tool.pyand 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