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

Multiple Directory Support Broken #167

Closed
josephtate opened this issue Jan 30, 2017 · 4 comments
Closed

Multiple Directory Support Broken #167

josephtate opened this issue Jan 30, 2017 · 4 comments
Labels

Comments

@josephtate
Copy link

Somewhere between 1.1.6 and 1.2.0, the multiple directory support broke. I have this config:

[composite:main]
use = egg:Paste#urlmap
/pypi/unstable/ = unstable
/pypi/devel/ = devel
/pypi/stable/ = stable
/pypi/production/ = production

[app:unstable]
use = egg:pypiserver#main
root = /var/pypiserver/packages/unstable
password_file = /var/pypiserver/.htpasswd

[app:devel]
use = egg:pypiserver#main
root = /var/pypiserver/packages/devel
password_file = /var/pypiserver/.htpasswd

[app:stable]
use = egg:pypiserver#main
root = /var/pypiserver/packages/stable
password_file = /var/pypiserver/.htpasswd

[app:production]
use = egg:pypiserver#main
root = /var/pypiserver/packages/production
password_file = /var/pypiserver/.htpasswd

[server:main]
use = egg:gunicorn#main
host = 127.0.0.1
port = 8002
workers = 5
accesslog = -

Which works fine for 1.1.6-1.1.8, but under 1.2.0, each of the configured package directories show the same list of packages. I didn't narrow down WHICH directory is being served, but it's either the devel or unstable one (first or last in C ordering).

I could not run 1.1.9 and 1.1.10 successfully because of a paste_app_factory error.

@mplanchard
Copy link
Contributor

Thanks for the bug report @josephtate. We'll be looking into this. In the meantime, any extra information you could provide would be helpful including:

  • operating system
  • log output
  • which of the directories is being served

Thanks!

@josephtate
Copy link
Author

The OS is Precise (Ubuntu 12.04) running python 2.7.3
The log output didn't have anything telling in it.
I think it's serving the first directory it finds (devel).

I don't have the setup anymore unfortunately, and it was running in production, so I can't take it down again to run more tests. I've locked it to version 1.1.8 in the meantime.

@digitalresistor
Copy link
Contributor

https://github.com/pypiserver/pypiserver/blob/v1.2.0/pypiserver/__init__.py#L131

and

https://github.com/pypiserver/pypiserver/blob/1.1.8/pypiserver/__init__.py#L42

Are vastly different.

The newer code imports app from _app, and returns it, however previously it would remove it from sys.modules, and re-import it, thereby creating a new app.

@josephtate
Copy link
Author

The pull request fixes the issue! Thanks @bertjwregeer

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

No branches or pull requests

3 participants