Open reivilibre opened 2 years ago
It might be something like this that is needed:
packages = [
{ include = "src/hypercorn" }
]
Sorry for the late reply. Anyway, thanks for reporting it. The issue seems to related to poetry which I do not familiar with. Try install from pypi? pip install nonecorn==0.14.1dev1
By the way, this branch is intended to be the test branch of hypercorn, so its version number is always dev. I have already used some additional features, such as gunicorn process management, zerocopy, etc., but the upstream may not fully accept my features, so I released them separately in pypi.
Since it is a dev branch, this repo is specially prepared for those who are particularly interested in asgi, because it implements every asgi extension, although the documentation is not yet complete, but I believe those people are looking at the code directly.
For users who want to try new features, you can take a look at my usage first, at there. The easiest way to start is to read hypercorn's document because it's 100% compatible with hypercorn, the only difference would be the support for asgi extensions, gunicorn and some extra code.
Sorry for the late reply. Anyway, thanks for reporting it. The issue seems to related to poetry which I do not familiar with. Try install from pypi?
pip install nonecorn==0.14.1dev1
I was trying to package my application (which was depending on nonecorn because I needed some of your ASGI extensions) in a situation where I have to install from the sdist. When you run pip install nonecorn
then, depending on your system, pip will likely prefer to use the wheel. But if pip used the sdist from PyPI then I think it would fail with the same error. (basically the sdist that has been uploaded isn't valid since you can't use it to build the wheel.)
I'm not that familiar with poetry either but I wonder if
packages = [
{ include = "src/hypercorn" }
]
would work under [tool.poetry]
in pyproject.toml
?
I find it confusing that there's both a setup.py
and a pyproject.toml
— I don't know if this is nonecorn specific though. I would expect to only see pyproject.toml
on a Poetry project.
I find it confusing that there's both a setup.py and a pyproject.toml — I don't know if this is nonecorn specific though. I would expect to only see pyproject.toml on a Poetry project.
Upstream has changed from setuptools to poetry, but I prefer setuptools, so I keep setup.py remain.
Actually I have already used pip install nonecorn
in my project, and it works fine. What system and python version are you using?
And I wonder if this package is able to build on your system with python setup.py sdist bdist_wheel
, that's what I have used to build and upload to pypi.
Actually I have already used pip install nonecorn in my project, and it works fine
This is because it's using the wheel, which isn't affected by this problem. However, the sdists (source distributions) don't work. To reproduce, you can also try pip install --no-binary :all: nonecorn==0.14.1dev1
, which forces pip not to use the wheel. You should observe that it also fails with the error given here.
When someone packages something for a distribution, they usually want to use a source distribution.
My system here today is Ubuntu 22.04 with Python 3.10.6, but I was trying to package on NixOS 22.05 with Python 3.9 I think — I don't think the system seems to affect the fact that the sdists don't work.
Upstream has changed from setuptools to poetry, but I prefer setuptools, so I keep setup.py remain.
Somewhat fair enough, the world of Python packaging is a mess in my opinion and it can be very confusing. However, instead of keeping setuptools, you seem to have ended up with some frankensteinian hybrid of the two :P. The sdist seems to be relying on Poetry to build, which strikes me as unusual if you built the project with python setup.py sdist
...
This section is in pyproject.toml
:
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
That tells pip to use poetry to install the project, when it's installed bare. This is essentially a bug if installing via Poetry doesn't work. Maybe the easiest solution is to just remove pyproject.toml if you don't want to touch Poetry?
When you build packages (e.g. python setup.py sdist bdist_wheel
) I always recommend installing them in a fresh venv with e.g. pip install path/to/dist/nonecorn-x.y.z.tar.gz
to ensure they work.
However: just now I added
packages = [
{ include = "src/hypercorn" }
]
to the [tool.poetry]
section in pyproject.toml
and I can confirm it now works when installing it.
So it seems that poetry conflicts with setuptools. I'll have a try later.
To reproduce:
In a fresh venv,
I can't see any option in
pyproject.toml
that tells it the module is actually called 'hypercorn' not 'nonecorn'; suspect there's something missing but not sure