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

[TODO] investigate switching from pipenv + setuptools to poetry #399

Closed
ITProKyle opened this issue Jul 30, 2020 · 1 comment
Closed

[TODO] investigate switching from pipenv + setuptools to poetry #399

ITProKyle opened this issue Jul 30, 2020 · 1 comment
Assignees
Labels
maintenance General repo or CI/CD upkeep priority:low Low priority issue or pull request
Milestone

Comments

@ITProKyle
Copy link
Collaborator

Summary

poetry is a single tool that manages virtual environments, dependencies, packaging, and publishing.

When compared directly with pipenv, poetry is significantly faster when handling dependencies. This is a noticeable issue with this project as the dev dependencies can take quite some time to sync. It also supports the new python standard pyproject.toml.

Considerations

  • How will this impact our Pyinstaller builds?
  • How will this impact the ability to install Runway from GitHub? (pip, pipenv, poetry)
  • How will it impact the developers/maintainers? (other than requiring a different tool to be installed)
@ITProKyle ITProKyle added priority:low Low priority issue or pull request maintenance General repo or CI/CD upkeep labels Jul 30, 2020
@ITProKyle
Copy link
Collaborator Author

I spent a bit of time working through this and here are my findings.

Pros

  • faster dependency resolution (poetry>=1.1)
  • when adding a dependency, it has a lot more logic around factoring compatibility. it includes the project dependencies, their dependencies, and the python version requirements of all involved. when something is not compatible, it provides great information as to why it's not so that it can be resolved.
  • single tool for build and publish
  • single configuration file (pyproject.toml vs setup.py + setup.cfg
  • poetry would be able to install runway from github if it was a poetry project (see cons for details)
  • dependency version per python version (see zipp, pydocstyle, pylint, or pytest below)

Cons

I stopped investigation after running into the vcs versioning issue.

Conclusion (for now)

In its current state, even though I really want the performance improvement and file consolidations, I don't feel that it would be advantageous for us to move to poetry. Personally, I don't want to give up vcs versioning as it makes building/releasing pre-release build and official releases much easier in our current system.

Once the plugin system is added to poetry, this issue should be revisited as vcs versioning should then be possible.

Resulting pyproject.toml

[tool.poetry]
name = "runway"
# version can't be set from git automatically yet
# support for something like this is slated for v1.2 - https://github.com/python-poetry/poetry/pull/1237
version = "1.11.0-dev0"
description = "Simplify infrastructure/app testing/deployment"
authors = ["Onica Group LLC <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
homepage = "https://docs.onica.com/projects/runway"
repository = "https://github.com/onicagroup/runway"
documentation = "https://docs.onica.com/projects/runway"
keywords = ["cli"]
classifiers = [
    "Intended Audience :: Developers",
    "Topic :: Utilities",
    "Natural Language :: English",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 2",
    "Programming Language :: Python :: 2.7",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.6",
    "Programming Language :: Python :: 3.7",
]
packages = [
    { include = "runway" }
]

[tool.poetry.dependencies]
python = ">=2.7 !=3.0.* !=3.1.* !=3.2.* !=3.3.* !=3.4.* <4"  # based on other dependency reqs

awacs = "*"
awscli = ">=1.16.308 <2.0"  # awscli included for embedded hooks and aws subcommand
"backports.tempfile" = { version = "*", python = "<3.2" }
boto3 = "^1.9.111"
botocore = ">=1.12.111"  # matching awscli/boto3 requirement
cfn_flip = "^1.2.1"  # 1.2.1+ require PyYAML 4.1+
cfn-lint = "*"
click = "^7.1"
coloredlogs = "*"
docker = "*"
formic2 = "*"  # inherited from stacker 1.7.0 requirements
future = "*"
gitpython = "*"
importlib-metadata = { version = "*", python = "<3.8" }
jinja2 = "^2.7"  # inherited from stacker 1.7.0 requirements
packaging = "*"  # component of setuptools needed for version compare
pyhcl = "~0.4"
pyOpenSSL = "*"    # for embedded hook & associated script usage
PyYAML = ">=4.1 <5.3"  # match awscli top-end
requests = "*"
schematics = "~2.0.1"  # inherited from stacker 1.7.0 requirements
Send2Trash = "*"
six = "^1.13"
troposphere = "^2.4"
typing = { version = "*", python = "<3.5" }
# botocore pins its urllib3 dependency like this, so we need to do the
# same to ensure v1.25+ isn't pulled in by pip
urllib3 = ">=1.20 <1.25"
yamllint = "*"
zipp = [  # dependency of importlib-metadata, dependency of pytest, cfn-lint, & others
    { version = "*", python = "^3.6" },
    { version = "^1", python = "<3.6" }  # 2.0.0 drops support for python 3.5
]
zgitignore = "*"  # for embedded hooks

[tool.poetry.dev-dependencies]
dunamai = {version = "^1.3.0", python = "^3.5"}
flake8 = "^3.8.3"
flake8-docstrings = "^1.5.0"
isort = "^4.3.21"  # restricted by pylint
mock = "~=3.0.5"  # TODO remove when dropping python 2
moto = "^1.3.14"
pep8-naming = "^0.11.1"
py = "1.9.0"  # TODO replaces uses with pathlib
pydocstyle = [
    { version = "^5.0.0", python = "^3.5" },
    { version = "^3.0.0", python = "^2.7" }  # 4.0.0 drops support for python 2
]
PyInstaller = "3.5"
pylint = [
    { version = "^2.5.3", python = "^3.5" },
    { version = "^1.9.5", python = "^2.7" }
]
pytest = [
    { version = "^6.0.1", python = "^3.5" },
    { version = "^4.6.11", python = "^2.7" }  # last version that supports 2.7
]
pytest-cov = "^2.10.0"
testfixtures = "^6.14.1"

[tool.poetry.scripts]
runway = "runway._cli.main:cli"

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

@ITProKyle ITProKyle self-assigned this Aug 4, 2020
@ITProKyle ITProKyle added the status:on_hold Task was recently worked on but is now on hold label Aug 4, 2020
@ITProKyle ITProKyle removed the status:on_hold Task was recently worked on but is now on hold label May 26, 2021
@ITProKyle ITProKyle added this to the v2.1.0 milestone May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance General repo or CI/CD upkeep priority:low Low priority issue or pull request
Projects
None yet
Development

No branches or pull requests

1 participant