steiza / simplepypi Goto Github PK
View Code? Open in Web Editor NEWA really, really, simple HTTP PyPI-like server
License: MIT License
A really, really, simple HTTP PyPI-like server
License: MIT License
On line 200 of simplepypi/simplepypi/bin/simplepypi, using 'r'
as the open method causes uploads to fail in Python 3, throwing encoding errors. Switching to 'rb'
fixes this.
Currently, the endpoint for the PyPiPackageHandler
only returns the latest version so pip is limited to only being able to install from there. Changing the handler to return a list of all available versions will allow packages to be installed from any version that exists on the server.
Hi!
I'm currently evaluating ways to provide in-house packages and this looks like a good option, but having any of the employees able to upload packages doesn't sound very good (a mistake happens easily).
I had a quick look through the code, and I think simply deleting IndexHandler::post()
should be enough? Is there anything else that needs to be done?
Thanks for writing this light pypi server!
It seems that you have hard coded that all files upload are saved as tar.gz. This is a problem when you are uploading other file formats, such as zip or binary (egg).
I did a very similar twisted pypi server concept and got stuck with the exact issue. I could not find away to tell what the filename was being uploaded from pip.
If you manage to find away, please let me know. But I don't think the behaviour should be to save all files as tar.gz.
Hello, i try using your package but i get this error, i don't understand why os.path.join is adding slashes in the package_path since i'm running this on windows
>C:\Python27\python.exe C:\Python27\Scripts\simplepypi
Running on http://127.0.0.1:8000
2017-06-06 11:35:17,861 - INFO - 200 GET / (127.0.0.1) 0.00ms
2017-06-06 11:35:17,913 - WARNING - 404 GET /favicon.ico (127.0.0.1) 1.00ms
2017-06-06 11:35:19,963 - ERROR - Uncaught exception GET /packages (127.0.0.1)
HTTPServerRequest(protocol='http', host='127.0.0.1:8000', method='GET', uri='/packages', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language': 'fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4', 'Accept-Encoding': 'gzip, deflate, sdch, br', 'Host': '127.0.0.1:8000', 'Accept': 'text/html,applicat
ion/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', 'Dnt': '1', 'Connection': 'keep-alive', 'Referer': 'http://127.0.0.1:8000/', 'Upgrade-Insecure-Requests': '1'
})
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\tornado\web.py", line 1509, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "C:\Python27\Scripts\simplepypi", line 141, in get
contents = os.listdir(package_path)
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\Python27\\Scripts\\packages/*.*'
I did a cron script to chmod 444 all files inside packages directory.
With this, the user get a HTTP 500 if he tries to upload a new package with same name/version.
Obviously, you cannot be root to do that. Root simply ignores 444 for himself.
If after an upload, a chmod can be issued, this kind of solve this, for now.
Or a file.exists may solve it too.
What do you think?
Best,
Marco
Some tools (e.g. Flit) produce packages with a period in their name (e.g. abc.xyz
) when building a native namespace package.
When build with pip + Flit the resulting wheel file has the periods replaced by an underscore (e.g. abc_xyz-0.1.2-py3-none-any.whl
). This wheel can be uploaded to a simplepypi server, but cannot be downloaded.
When I check http://localhost:8000/packages
(where the simplepypi server is located) the package appears in the list as abc.xyz
, and when clicked it brings me to http://localhost:8000/packages/abc.xyz
, which shows the wheel file abc_xyz-0.1.2-py3-none-any.whl
.
I have tried to download it using abc.xyz
:
$ pip install -i http://localhost:8000/pypi 'abc.xyz'
Looking in indexes: http://localhost:8000/pypi
ERROR: Could not find a version that satisfies the requirement abc.xyz (from versions: none)
ERROR: No matching distribution found for abc.xyz
And with abc_xyz
:
$ pip install -i http://localhost:8000/pypi 'abc_xyz'
Looking in indexes: http://localhost:8000/pypi
ERROR: Could not find a version that satisfies the requirement abc_xyz (from versions: none)
ERROR: No matching distribution found for abc_xyz
I am able to download other packages from http://localhost:8000/pypi
so long as they do not have a period in their name.
I am able to download packages with periods in their name from the official PyPI server at pypi.org
, and from a PyPI server hosted by Nexus.
There is no license in this repository. Was that intended?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.