Changelog#
Changelog for pyproject2conda
Unreleased#
See the fragment files in changelog.d
v0.22.0 — 2025-06-06#
Deprecated#
Deprecating using underscores in option names in
pyproject.toml. For example, usingtemplate_pythonundertool.pyproject2condawill lead to aDeprecationWarning. We’ll fully remove support for underscored names in a future version.
v0.21.0 — 2025-06-05#
Changed#
The config file version of command line options now accept either dashes or underscores. For example, the command line option
--template-pythonnow respects eithertemplate-pythonortemplate_pythonin thetool.pyproject2condatable ofpyproject.toml. Note that you have to use either all dashes or all underscores, not a mix. The parser first looks for options with dashes, then falls back to underscores, so if they are both present, the dashed version will win.
v0.20.0 — 2025-06-05#
Changed#
--nameoption (i.e., thenamefield in an environment.yaml file) now accepts the follinging fields:{py_version}: the full python version passed in with--python-version, or specified inpyproject.toml{py}: the python version without"."(so, for example, if--python-version=3.8,{py}will expand to"38").{env}: the environment name. Only applicable with theprojectsubcommand.
v0.19.1 — 2025-02-19#
Changed#
Bugfix in pre-commit hooks. Now respects
header = falsein environments.
v0.19.0 — 2025-01-29#
Added#
Added pre-commit hooks
pyproject2conda-project,pyproject2conda-yaml, andpyproject2conda-requirements.
Changed#
Changed default of
--overwritetoforce. This simplifies using withpre-commit.--commit-commanddefaults topre-commitwhen run under pre-commit
v0.18.0 — 2025-01-24#
Added#
Can now specify current package in dependency-groups like with extras. For example, with:
[project]
name = "mypackage"
...
optional-dependencies.opt = [ "opt1" ]
[dependency-groups]
dev = [
"pytest",
"mypackage[opt]"
]
Will render optional dependencies from opt extra when using group dev
Added flag
--pip-onlyto treat all requirements as pip requirements inenvironment.yamlfiles. Closes #8
v0.16.0 — 2024-12-31#
Changed#
Read default version from first found file, in order,
.python-version-defaultand.python-version. This allows for “default” version being different from pinned version specifier, as the latter can be a range of python values.
v0.15.0 — 2024-12-17#
Added#
Can now pass requirements for package with
--req/-r "-e ."for example.
v0.14.0 — 2024-12-16#
Added#
--pythonflag now accepts optionsdefault,all,lowest, andhighest.defaultsets python to value found in.python-versionfile in current directory. Other options extract values entries of form"Programming Language :: Python :: 3.10"', etc,frompyproject.toml:project.classifierstable.all: All specified python versionlowest: Lowest python versionhighest: Highest python version
Added
--reqs-extand--yaml-extoptions.
v0.13.0 — 2024-11-04#
Changed#
Allow
overridesfor all options.overridesoverride environment options.
v0.12.0 — 2024-11-04#
Removed#
Removed comments based (
# p2c: ...) support. Specify changes withtool.pyproject2conda.dependenciestable only. This greatly simplifies the code, and has become the primary way to use thepyproject2conda.
Added#
Added PEP 735 support. This includes adding option
--groupto the cli, andgroupskey totools.pyproject2conda.envs....tables. There is also an option--extra-or-group(orextras_or_groupsin 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_envsnow passed the environment name asextras_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(orskip_package = trueinpyproject.toml) to skip package dependencies.
v0.11.0 — 2023-11-28#
Added#
Can now access “build-system.requires” as an extra. This can be useful for creating isolated environments to build a package.
Changed#
Can now specify
pipas a conda dependency. This is needed for cases that there are no pip dependencies in the environment, but you want it there for installing local packages. This may be the case if usingconda-lockon an environment. Note that, much like python is always first in the dependency list, pip is always last.
v0.10.0 — 2023-11-17#
Added#
Can now specify conda changes using
tool.pyproject2conda.dependenciestable. This is an alternative to using# p2c:comments.Refactored code. Split
parsertorequirementsandoverrides. Also cleaned up the parsing logic to hopefully make future changes simpler.
v0.9.0 — 2023-11-14#
Added#
Default is now to remove whitespace from dependencies. For example, the dependency
module > 0.1will becomemodule>0.1. To override this behaviour, pass the option--no-remove-whitespace.Now supports python version
>3.8,<=3.12Can now specify
extras = falsein pyprojec.toml to skip any extras. The default (extras = true) is the same asextras = [env_name]whereenv_nameis the name of the environment (e.g.,tool.pyproject2conda.envs.env_name).
v0.8.0 — 2023-10-02#
Added#
Added option to either raise error, or print message for environments with no dependencies.
Changed#
pyproject2conda now works with
pyproject.tomlfiles with no dependencies.
v0.7.0 — 2023-09-26#
Added#
Now use
loggingto print info output.
Changed#
cli now uses
typer. Since the program was already typed, this simplifies the interface.Program can now be called with any of
pyproject2conda,p2c, orpython -m pyproject2conda.Added cli options to web documentation.
Fixed small typos and typing issues.
The cli option
--python-includenow requires an argument. This is due totypernot liking options with zero or one arguments. Instead of the bare flag--python-includeincluding the python spec frompyproject.toml, you have to pass--python-include inferto get that behavior.Added extra
allto pip install options. The default is to not includerichorshellingham. Usingpip install pyproject2conda[all]includes these optional packages. Note that the conda-forge recipe is based on the plain install (i.e., norichorshellingham). However, the conda-froge recipe fortyperdoes include these. That means, if you want to installpyproject2condawithout the optional extras, you’ll have to use pip.
v0.6.1 — 2023-09-22#
Changed#
Fixed edge case where
--overwrite=checkand have auser_config. Now when usingp2c projectwith auser_configandoverwrite=check, the timestamp of the output file will be compared to both thefilename=pyproject.tomlanduser_config.
v0.6.0 — 2023-09-19#
Added#
Added
projectsubcommand. This uses a configuration inpyproject.tomlto build multiple enivonments in one go.Added
--depsand--reqsflags to include extra conda and pip requirements.Added
--overwriteto check if output file exists.Now (correctly) using rich_click.
Added tests for all new cases, and some edge cases.
v0.5.1 — 2023-09-09#
Added#
Added
--sort/--no-sortflag to cli. Default is to sort dependencies. This fixes issues with changing order inpyproject.tomlleading to different yaml files.
Changed#
Changed structure of the repo to better support some third party tools.
Moved nox environments from
.noxto.nox/{project-name}/envs. This fixes issues with ipykernel giving odd names for locally installed environments.Moved repo specific dot files to the
configdirectory (e.g.,.noxconfig.tomltoconfig/userconfig.toml). This cleans up the top level of the repo.added some support for using
nbqato run mypy/pyright on notebooks.Added ability to bootstrap development environment using pipx. This should simplify initial setup. See Contributing for more info.
Main repo now on usnistgov.