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

use poetry instead of requirements.txt #566

Open
3 tasks
zhukovgreen opened this issue Aug 12, 2020 · 0 comments
Open
3 tasks

use poetry instead of requirements.txt #566

zhukovgreen opened this issue Aug 12, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zhukovgreen
Copy link
Contributor

zhukovgreen commented Aug 12, 2020

Poetry (https://github.com/python-poetry/poetry) is python modern dependency management tool, which is compliant with PEP 517 (pyproject.toml).

Advantages of using poetry for our project:

  1. Dependencies resolver for multiple python environments as a separate set of dependencies versions (no need to find the max common between py2 and py3 versions)
  2. Dependencies are locked with the special lock file which ensures 100% matching python environments installed in different systems and in different time
  3. pyproject.toml support allows us to have all configurations just in one file (pytest, isort, black, ex setup.py) (with one exception - flake8 still not supports pyproject)

Some examples of workflows with the poetry:

$ poetry install    # create virtual env and install project dependencies inside
$ poetry update   # updates all dependencies inside all environment to the most recent available versions respecting the deps constraints
$ poetry env use 2.7 && poetry run pytest # run pytest in py2 environment
$ poetry env use 3.8 && poetry run pytest # run pytest in py3 environment

Example of the poetry setup inside pyproject.toml:

[tool.poetry]
name = "leapp-repository"
version = "0.0.1"
description = ""
authors = ["ZhukovGreen <[email protected]>"]

[tool.poetry.dependencies]
python = "~2.7 || ^3.6"
#leapp = {git = "https://github.com/oamg/leapp.git"}
leapp = {path = "../leapp", develop = true}
zipp = {version = "^1.2", python = "~2.7"}
ipaddress = {version = "^1.0.23", python = "~2.7"}
distro = "^1.5.0"

[tool.poetry.dev-dependencies]
coverage = {extras = ["toml"], version = "^5.0.3"}
pathlib2 = {version = "^2.3", python = "~2.7"}
pytest = [
    {version = "^4.6.11", python = "~2.7"},
    {version = "^6.0.0", python = "^3.6"}

]
pytest-mock = [
    {version = "^2.0.0", python = "~2.7"},
    {version = "^3.1.1", python = "^3.6"}
]
pytest-cov = "^2.8.1"
pyudev = "^0.22.0"
ipdb = "^0.13.2"
mock = [
    {version = "^3.0.5", python = "~2.7"},
    {version = "^4.0", python = "^3.6"}
]
pylint = [
    {version = "^1.9", python = "~2.7"},
    {version = "^2.4.4", python = "^3.6"}
]
flake8 = "^3.7.9"
pytest-xdist = "^1.33.0"

[build-system]
requires = ["poetry>=1.0.0"]
build-backend = "poetry.masonry.api"

Under the scope:

  • add poetry setup to the pyproject.toml and remove requirements.txt
  • update Makefile to use poetry
  • update ci to use poetry

resolves #504

@zhukovgreen zhukovgreen added the enhancement New feature or request label Aug 12, 2020
@zhukovgreen zhukovgreen self-assigned this Aug 12, 2020
MichalHe pushed a commit to MichalHe/leapp-repository that referenced this issue Jun 21, 2022
This patch introduces support for actors being able to let leapp skip
phases.
Phases can be skipped by an actor using leapp.messaging.commands.SkipPhasesUntilCommand
like this within the process method:
```python
self._messaging.command(SkipPhasesUntilCommand(until_phase='report'))
```

This will make leapp skip phases until it hits the 'report' phase.
Update(pstodulk): including the 'report' phase as well.

Signed-off-by: Vinzenz Feenstra <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant