pypiserver / pypiserver

Minimal PyPI server for uploading & downloading packages with pip/easy_install

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

default_config entrypoint for WSGI not working anymore

gjulianm opened this issue · comments

As of c668b18, the default_config function has been removed. The issue is that in the README, that function is still used for WSGI scripts: https://github.com/pypiserver/pypiserver/blame/master/README.rst#L674

What is the alternative after that change? I can test it and amend the README as needed.

Thank you very much

commented

I just set up a new pypiserver and I had to pass the arguments directly to pypiserver.app, i.e. just calling
pypiserver.app(roots="yoursite/packages", password_file="yoursite/htpasswd")
seems to do the job.

Note that the keyword root leads to a deprecation error and I had to use roots instead.

Hey @gjulianm and @szleb, I'm very sorry for the long silence here! Thanks for noticing this and opening the issue @gjulianm, this is an important point and definitely we should update this detail in the README. @szleb thanks a lot for your suggestion on how to overcome this! @gjulianm did you by any chance manage to solve the issue with @szleb's suggestion or some other? If you did, that'd be great if you could update us on how you solved this and maybe then we can indeed update the README. Otherwise, I will try to give it a go when I have some time and will update the documentation ✌️

I think I tried that suggestion and it didn't work properly, so I reverted back to an old version and kept using the old calls, sorry.

Hey @gjulianm no worries at all! It's a very important catch that we're still having the references to default_config in the README while it's been deprecated. That's in any case worth fixing and then for sure we should document the alternative ⭐ This issue could be a good home for addressing this problem with the docs 👍

So far I found the following occurrences:

  1. pypiserver/README.md

    Lines 429 to 433 in f14b92c

    ```shell
    import pam
    pypiserver.default_config(auther=pam.authenticate)
    ```
  2. pypiserver/README.md

    Lines 830 to 839 in f14b92c

    ```python
    import pypiserver
    conf = pypiserver.default_config(
    root = "/yoursite/packages",
    password_file = "/yoursite/htpasswd", )
    application = pypiserver.app(**conf)
    ```
  3. pypiserver/README.md

    Lines 429 to 433 in f14b92c

    ```shell
    import pam
    pypiserver.default_config(auther=pam.authenticate)
    ```

I think that @szleb's solution should work for most of these scenarios, so that'd be awesome to validate and update the README accordingly (including the use of other functions) 👍 I hope I can get to it shortly, however any help is certainly appreciated ✨ 😺