Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] Add run command #21

Closed
stanislavlevin opened this issue Dec 15, 2022 · 0 comments · Fixed by #29
Closed

[RFE] Add run command #21

stanislavlevin opened this issue Dec 15, 2022 · 0 comments · Fixed by #29

Comments

@stanislavlevin
Copy link
Owner

stanislavlevin commented Dec 15, 2022

Abstract

This RFE proposes to add run command to execute an arbitrary command within
non-isolated venv-based Python virtual environment.

Motivation

It's often required to run a project's tests during downstream packaging in the
global isolated environment. For example, the user of such environment is
unprivileged (can't install distributions into global sitepackages) and has no
access to Internet (can't install distributions from package indexes). On the
other hand built Python distributions should not be unintentionally installed
into user sitepackages to avoid their interference with any further
distributions being tested. Though some of tests can be run in current Python
environment without any change (e.g. flat layout and pure Python package),
some may require setting of PYTHONPATH environment variable (e.g. src layout
and pure Python package). But things may be more complex in case of
arch-dependent Python packages, .pth hooks or entry_points plugins where
PYTHONPATH way can't help. This is one of the reasons why
venv(stdlib)/virtualenv(third-party) exists. There is really nice tool tox
for automation of testing process. But it's overkill to use it for the
aforementioned task, for example:

  • tox always wants to download and install dependencies of test env and
    dependencies of package (though this can be overcome with options and external
    plugins)
  • tox has many runtime dependencies

Specification

run command do the following:

  • create minimal virtual environment with the help of stdlib's venv.
    The generated environment:
    • has no installed pip, setuptools
    • has access to system and user site packages
  • generate console scripts of system and user site packages to access them within venv
  • install built distribution into venv without any dependencies
  • spawn a command in subprocess

Example

python -m pyproject_installer run -- pytest -vra                                 
stanislavlevin added a commit that referenced this issue Dec 30, 2022
This can be used by other parts of the project.

Fixes: #21
stanislavlevin added a commit that referenced this issue Dec 30, 2022
This can be used by other parts of the project.

Fixes: #21
stanislavlevin added a commit that referenced this issue Dec 30, 2022
stanislavlevin added a commit that referenced this issue Dec 30, 2022
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
stanislavlevin added a commit that referenced this issue Dec 30, 2022
They can be used by other tests.

Fixes: #21
stanislavlevin added a commit that referenced this issue Dec 30, 2022
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
stanislavlevin added a commit that referenced this issue Dec 30, 2022
stanislavlevin added a commit that referenced this issue Dec 30, 2022
stanislavlevin added a commit that referenced this issue Jan 9, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
stanislavlevin added a commit that referenced this issue Jan 9, 2023
They can be used by other tests.

Fixes: #21
stanislavlevin added a commit that referenced this issue Jan 9, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
stanislavlevin added a commit that referenced this issue Jan 9, 2023
stanislavlevin added a commit that referenced this issue Jan 9, 2023
stanislavlevin added a commit that referenced this issue Jan 9, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
stanislavlevin added a commit that referenced this issue Jan 9, 2023
They can be used by other tests.

Fixes: #21
stanislavlevin added a commit that referenced this issue Jan 9, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
stanislavlevin added a commit that referenced this issue Jan 9, 2023
stanislavlevin added a commit that referenced this issue Jan 9, 2023
stanislavlevin added a commit that referenced this issue Jan 9, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
They can be used by other tests.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 9, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
They can be used by other tests.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
They can be used by other tests.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
They can be used by other tests.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
This can be used by other parts of the project.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
`run` command do the following:
- create minimal virtual environment with the help of stdlib's `venv`.
  The generated environment:
  - has no installed pip, setuptools
  - has access to system and user site packages
- generate console scripts of system and user site packages to access them
  within venv
- install built distribution into venv without any dependencies
- spawn a command in subprocess

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
They can be used by other tests.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Previously, an exit code was `1` in those cases. With this change
it's `2`.

Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
stanislavlevin added a commit that referenced this issue Jan 10, 2023
Fixes: #21
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant