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

add support for pypi --extra-index-url #1012

Merged
merged 2 commits into from Nov 7, 2015

Conversation

@paul-krohn
Copy link
Contributor

paul-krohn commented Sep 17, 2015

Add support for URLs passed to pip with pypi --extra-index-url, so you can include code from both public & private PyPi repos.

@skoenig

This comment has been minimized.

Copy link

skoenig commented Nov 5, 2015

Perhaps not necessary, I just closed my PR #950 because I found another solution (see comment).

@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Nov 5, 2015

I'm open to merging this. Code looks OK. I haven't tested.

@@ -25,6 +25,10 @@ class FPM::Package::Virtualenv < FPM::Package
option "--other-files-dir", "DIRECTORY", "Optionally, the contents of the " \
"specified directory may be added to the package. This is useful if the " \
"virtualenv needs configuration files, etc.", :default => nil
option "--pypi-extra", "PYPI_EXTRA_URL",

This comment has been minimized.

Copy link
@jordansissel

jordansissel Nov 5, 2015

Owner

Curious, Is this a good name for the flag? Would it be more descriptive as --pypi-extra-url ? Thoughts? :)

@@ -25,6 +25,10 @@ class FPM::Package::Virtualenv < FPM::Package
option "--other-files-dir", "DIRECTORY", "Optionally, the contents of the " \
"specified directory may be added to the package. This is useful if the " \
"virtualenv needs configuration files, etc.", :default => nil
option "--pypi-extra", "PYPI_EXTRA_URL",
"PyPi extra-index-url for pointing to your priviate PyPi",

This comment has been minimized.

Copy link
@jordansissel

jordansissel Nov 5, 2015

Owner

Indent these 3 lines (the help text, multivalued, and default) by 2 more spaces

attributes[:virtualenv_pypi],
package)
extra_index_url_args = []
if !attributes[:virtualenv_pypi_extra_index_urls].nil?

This comment has been minimized.

Copy link
@jordansissel

jordansissel Nov 5, 2015

Owner

Suggestion - instead of checking !foo.nil?, you can just check foo:

# if !attributes[:virtualenv_pypi_extra_index_urls].nil?
if attributes[:virtualenv_pypi_extra_index_urls]

Non-nil values are "truthy" in ruby. Just an FYI, no code change required.

@paul-krohn

This comment has been minimized.

Copy link
Contributor Author

paul-krohn commented Nov 7, 2015

Thanks for the feedback; the solution/workaround of creating a config file doesn't work on hosted CI engines (Travis, Circle, etc). In the mean time I needed a solution; it does a couple more things like guessing the package name and version; any interest in porting any of that to get_metadata.py?

@jordansissel

This comment has been minimized.

Copy link
Owner

jordansissel commented Nov 7, 2015

LGTM! Thanks much :)

jordansissel added a commit that referenced this pull request Nov 7, 2015
add support for pypi --extra-index-url
@jordansissel jordansissel merged commit 583376a into jordansissel:master Nov 7, 2015
jordansissel added a commit that referenced this pull request Jun 20, 2016
add support for pypi --extra-index-url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.