pulp / oci_env

9 stars 33 forks source link

Use a single pip install command on startup #111

Open mdellweg opened 1 year ago

mdellweg commented 1 year ago

oci_env calls pip in multiple places multiple times. Pip is not meant to be used that way wand will happily create conflicts with already installed packages or update otherwise pinned dependencies.

Consolidating all calls to pip install into a single one can be considered a hard blocker for using it in any kind of CI.

lubosmj commented 1 year ago
[lmjachky@localhost oci_env]$ oci-env shell
vTraceback (most recent call last):
  File "/usr/local/bin/pulp", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/pulp_cli/__init__.py", line 31, in main
    load_plugins()
  File "/usr/local/lib/python3.8/site-packages/pulp_cli/__init__.py", line 17, in load_plugins
    discovered_plugins: Dict[str, ModuleType] = {
  File "/usr/local/lib/python3.8/site-packages/pulp_cli/__init__.py", line 18, in <dictcomp>
    entry_point.name: entry_point.load()
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2516, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2539, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 827, in resolve
    dist = self._resolve_dist(
  File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 873, in _resolve_dist
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pulp-glue 0.18.0 (/usr/local/lib/python3.8/site-packages), Requirement.parse('pulp-glue==0.19.0'))
decko commented 1 year ago

oci_env only calls pip once with the dev_requirements.txt over the pulp-ci-centos image.

What if we bring up the discussion about subtituting pip with something that have a better dependency resolution like poetry. Just a pyproject.toml file and we could have both production and development dependencies, as well as other project settings.

mdellweg commented 1 year ago

What if we bring up the discussion about subtituting pip with something that have a better dependency resolution like poetry

The Packaging Team should be in that type of a discussion. They depend on ancient versions of setuptools sometimes.