diff --git a/pyproject.toml b/pyproject.toml index ecd660c..73a805f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ dependencies = [ "click < 9", "ruff < 1", "mypy < 2", - "pip-tools < 8", "pytest < 8", "result < 1", "build < 2", @@ -28,6 +27,7 @@ dependencies = [ "tomlkit < 1", "pdoc < 15", "mashumaro[orjson,toml] < 4", + "uv < 1", ] [project.optional-dependencies] diff --git a/pyrgo/cmds/lock.py b/pyrgo/cmds/lock.py index 1eebb15..3d49d47 100644 --- a/pyrgo/cmds/lock.py +++ b/pyrgo/cmds/lock.py @@ -22,14 +22,14 @@ def _initial_args( *, upgrade: bool, ) -> list[str]: - base_args = ["compile"] + base_args = ["pip", "compile"] if upgrade: - base_args.append("-U") + base_args.append("--upgrade") if env == core_deps_alias: return base_args - base_args.extend(["--no-strip-extras", "--extra", env]) + base_args.extend(["--extra", env]) return base_args @@ -45,8 +45,6 @@ def _complete_cmd( cmd.add_args( args=[ - "--strip-extras", - "--resolver=backtracking", "-o", config.requirements.joinpath(f"{env}.txt") .relative_to(config.cwd) @@ -98,7 +96,7 @@ def lock(*, generate_hashes: bool, envs: tuple[str, ...], upgrade: bool) -> None all_commands.extend( _complete_cmd( cmd=PythonCommandExec( - program="piptools", + program="uv", ).add_args( args=_initial_args( env=env, @@ -121,7 +119,7 @@ def lock(*, generate_hashes: bool, envs: tuple[str, ...], upgrade: bool) -> None all_commands.append( _complete_cmd( cmd=PythonCommandExec( - program="piptools", + program="uv", ).add_args( args=_initial_args( env=env, diff --git a/pyrgo/cmds/sync.py b/pyrgo/cmds/sync.py index ea19eb7..cec0a49 100644 --- a/pyrgo/cmds/sync.py +++ b/pyrgo/cmds/sync.py @@ -19,22 +19,16 @@ type=click.STRING, required=True, ) -@click.option( - "--editable/--no-editable", - "editable", - type=click.BOOL, - default=True, - show_default=True, -) -def sync(env: str, *, editable: bool) -> None: +def sync(env: str) -> None: """Sync current python environment to locked deps.""" config = PyrgoConf() ensure_env_exist(env=env, config=config, where="lock-files") piptools_command = PythonCommandExec( - program="piptools", + program="uv", ).add_args( args=[ + "pip", "sync", config.requirements.joinpath(f"{env}.txt") .relative_to(config.cwd) @@ -42,13 +36,12 @@ def sync(env: str, *, editable: bool) -> None: ], ) pip_command = PythonCommandExec( - program="pip", + program="uv", ).add_args( - args=["install", "--no-deps"], + args=["pip", "install"], ) - if editable: - pip_command.add_args(args=["-e"]) - pip_command.add_args(args=["."]) + + pip_command.add_args(args=["-e", "."]) program_execution = inform_and_run_program( commands=[ diff --git a/pyrgo/typing.py b/pyrgo/typing.py index f492d8a..b4e64b9 100644 --- a/pyrgo/typing.py +++ b/pyrgo/typing.py @@ -9,8 +9,7 @@ PyrgoProgram: TypeAlias = Literal[ "ruff", "mypy.dmypy", - "piptools", - "pip", + "uv", "build", "pytest", "pip_audit", diff --git a/requirements/core.txt b/requirements/core.txt index 55a5bb9..f70cf4a 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1,27 +1,15 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --output-file=requirements/core.txt --strip-extras pyproject.toml -# +# This file was autogenerated by uv v0.1.0 via the following command: +# uv pip compile --upgrade -o requirements/core.txt pyproject.toml boolean-py==4.0 # via license-expression build==1.0.3 - # via - # pip-tools - # pyrgo (pyproject.toml) cachecontrol==0.14.0 - # via - # cachecontrol - # pip-audit + # via pip-audit certifi==2024.2.2 # via requests charset-normalizer==3.3.2 # via requests click==8.1.7 - # via - # pip-tools - # pyrgo (pyproject.toml) cyclonedx-python-lib==6.4.1 # via pip-audit defusedxml==0.7.1 @@ -49,18 +37,14 @@ markupsafe==2.1.5 # jinja2 # pdoc mashumaro==3.12 - # via - # mashumaro - # pyrgo (pyproject.toml) mdurl==0.1.2 # via markdown-it-py msgpack==1.0.7 # via cachecontrol mypy==1.8.0 - # via pyrgo (pyproject.toml) mypy-extensions==1.0.0 # via mypy -orjson==3.9.13 +orjson==3.9.14 # via mashumaro packageurl-python==0.13.4 # via cyclonedx-python-lib @@ -71,18 +55,16 @@ packaging==23.2 # pip-requirements-parser # pytest pdoc==14.4.0 - # via pyrgo (pyproject.toml) +pip==24.0 + # via pip-api pip-api==0.0.30 # via pip-audit -pip-audit==2.7.0 - # via pyrgo (pyproject.toml) +pip-audit==2.7.1 pip-requirements-parser==32.0.1 # via pip-audit -pip-tools==7.3.0 - # via pyrgo (pyproject.toml) pluggy==1.4.0 # via pytest -py-serializable==1.0.0 +py-serializable==1.0.1 # via cyclonedx-python-lib pygments==2.17.2 # via @@ -93,17 +75,14 @@ pyparsing==3.1.1 pyproject-hooks==1.0.0 # via build pytest==7.4.4 - # via pyrgo (pyproject.toml) requests==2.31.0 # via # cachecontrol # pip-audit result==0.16.0 - # via pyrgo (pyproject.toml) rich==13.7.0 # via pip-audit ruff==0.2.1 - # via pyrgo (pyproject.toml) six==1.16.0 # via html5lib sortedcontainers==2.4.0 @@ -115,14 +94,12 @@ tomli==2.0.1 # build # mashumaro # mypy - # pip-tools # pyproject-hooks # pytest # vulture tomli-w==1.0.0 # via mashumaro tomlkit==0.12.3 - # via pyrgo (pyproject.toml) typing-extensions==4.9.0 # via # mashumaro @@ -130,15 +107,9 @@ typing-extensions==4.9.0 # result urllib3==2.2.0 # via requests +uv==0.1.0 vulture==2.11 - # via pyrgo (pyproject.toml) webencodings==0.5.1 # via html5lib -wheel==0.42.0 - # via pip-tools zipp==3.17.0 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/requirements/dev.txt b/requirements/dev.txt index c047826..62abb21 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,31 +1,17 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --extra=dev --output-file=requirements/dev.txt --strip-extras pyproject.toml -# +# This file was autogenerated by uv v0.1.0 via the following command: +# uv pip compile --upgrade --extra dev -o requirements/dev.txt pyproject.toml boolean-py==4.0 # via license-expression build==1.0.3 - # via - # pip-tools - # pyrgo (pyproject.toml) cachecontrol==0.14.0 - # via - # cachecontrol - # pip-audit + # via pip-audit certifi==2024.2.2 # via requests charset-normalizer==3.3.2 # via requests click==8.1.7 - # via - # pip-tools - # pyrgo (pyproject.toml) coverage==7.4.1 - # via - # coverage - # pytest-cov + # via pytest-cov cyclonedx-python-lib==6.4.1 # via pip-audit defusedxml==0.7.1 @@ -53,18 +39,14 @@ markupsafe==2.1.5 # jinja2 # pdoc mashumaro==3.12 - # via - # mashumaro - # pyrgo (pyproject.toml) mdurl==0.1.2 # via markdown-it-py msgpack==1.0.7 # via cachecontrol mypy==1.8.0 - # via pyrgo (pyproject.toml) mypy-extensions==1.0.0 # via mypy -orjson==3.9.13 +orjson==3.9.14 # via mashumaro packageurl-python==0.13.4 # via cyclonedx-python-lib @@ -75,18 +57,16 @@ packaging==23.2 # pip-requirements-parser # pytest pdoc==14.4.0 - # via pyrgo (pyproject.toml) +pip==24.0 + # via pip-api pip-api==0.0.30 # via pip-audit -pip-audit==2.7.0 - # via pyrgo (pyproject.toml) +pip-audit==2.7.1 pip-requirements-parser==32.0.1 # via pip-audit -pip-tools==7.3.0 - # via pyrgo (pyproject.toml) pluggy==1.4.0 # via pytest -py-serializable==1.0.0 +py-serializable==1.0.1 # via cyclonedx-python-lib pygments==2.17.2 # via @@ -97,21 +77,16 @@ pyparsing==3.1.1 pyproject-hooks==1.0.0 # via build pytest==7.4.4 - # via - # pyrgo (pyproject.toml) - # pytest-cov + # via pytest-cov pytest-cov==4.1.0 - # via pyrgo (pyproject.toml) requests==2.31.0 # via # cachecontrol # pip-audit result==0.16.0 - # via pyrgo (pyproject.toml) rich==13.7.0 # via pip-audit ruff==0.2.1 - # via pyrgo (pyproject.toml) six==1.16.0 # via html5lib sortedcontainers==2.4.0 @@ -124,16 +99,13 @@ tomli==2.0.1 # coverage # mashumaro # mypy - # pip-tools # pyproject-hooks # pytest # vulture tomli-w==1.0.0 # via mashumaro tomlkit==0.12.3 - # via pyrgo (pyproject.toml) types-toml==0.10.8.7 - # via pyrgo (pyproject.toml) typing-extensions==4.9.0 # via # mashumaro @@ -141,15 +113,9 @@ typing-extensions==4.9.0 # result urllib3==2.2.0 # via requests +uv==0.1.0 vulture==2.11 - # via pyrgo (pyproject.toml) webencodings==0.5.1 # via html5lib -wheel==0.42.0 - # via pip-tools zipp==3.17.0 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/tests/test_command_exec.py b/tests/test_command_exec.py index 6f2c6f6..ee1fcba 100644 --- a/tests/test_command_exec.py +++ b/tests/test_command_exec.py @@ -25,9 +25,9 @@ def test_new(self, program: PyrgoProgram) -> None: argnames=["command", "args", "expected"], argvalues=[ ( - PythonCommandExec(program="pip"), + PythonCommandExec(program="uv"), ["1", "2"], - ["pip", "1", "2"], + ["uv", "1", "2"], ), ], )