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

allow specifying a custom pypi url #6

Open
wbolster opened this issue Feb 17, 2016 · 4 comments
Open

allow specifying a custom pypi url #6

wbolster opened this issue Feb 17, 2016 · 4 comments

Comments

@wbolster
Copy link
Contributor

the pypi url is currently hardcoded, which makes it impossible to use this package properly with custom pypi repos (e.g. devpi). adding a customizable variable would be a solution for this. an auto-detect feature that uses the pip config file to obtain the index-url would be even better... :)

@palikar
Copy link

palikar commented Oct 26, 2018

I can fix that. I'll open a PR, if I find the time.

@wbolster
Copy link
Contributor Author

also there's PIP_INDEX_URL env var

@wbolster
Copy link
Contributor Author

hey @Wilfred thanks for picking this up.

that said, 216cd16 does not actually respect any of the configuration files or env vars, so this doesn't really ‘work out of the box’.

any advice on getting it working automatically?

@Wilfred
Copy link
Owner

Wilfred commented Nov 11, 2018

How about something like this?

(require 'subr-x)

(defun wh/set-url-from-pip ()
  (setq
   pip-requirements-index-url
   (string-trim
    (shell-command-to-string
     "pip config get global.index-url"))))

(add-hook 'pip-requirements-mode-hook
          #'wh/set-url-from-pip)

This will set the variable every time you open a new requirements file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants