CircleCI-Public / python-orb

Common CircleCI tasks for the Python programming language.
https://circleci.com/developer/orbs/orb/circleci/python
MIT License
13 stars 37 forks source link

Update install-packages.yml to allow for path args as a parameter when using `pip-dist` #74

Closed whardier closed 3 years ago

whardier commented 3 years ago

SEMVER Update Type:

Description:

Replaces static reference of path argument . with parameter set to default . and allows for packages referenced in setup.* via extras_require to be specifically installed or optionally installed along with . (ex: .[test] or . .[dev])

Motivation:

No need to install main packages if only dev packages are needed for certain jobs. Especially important when dealing with upstream package repositories outside of pypi.

Closes Issues:

Checklist:

KyleTryon commented 3 years ago

Hello @whardier ,

Would the existing args parameter not fit this use case?

whardier commented 3 years ago

Hello @whardier ,

Would the existing args parameter not fit this use case?

It does not. I am however currently using args to install .[dev] and other extras.. but the point is I want to only install .[dev] using this orb if possible.

Example: I only want to install .[dev] and not .. This is currently impossible since . is hard coded as a path argument:

              pip install -e . << parameters.args >>

And this patch changes that line to instead allow the . to be variably assigned to one or more paths (including specifying extras like dev or test which can be made available in setup.py.

              pip install -e << parameters.path-args >> << parameters.args >>

A poor alternative would be to make the args parameter default to -e . and trim down the command to pip install << parameter.args >>. However - that would break current logic and make a lot of people very sad. Hence: path-args with a default of ..