alexschimpf / fastapi-versionizer

FastAPI Versionizer
MIT License
81 stars 13 forks source link

requirements.txt missing in the distribution file in PyPI #19

Closed AsifArmanRahman closed 1 year ago

AsifArmanRahman commented 1 year ago

Issue

Source distribution file, which is uploaded to PyPI is missing the requirements.txt files, which the setup.py fails to open. https://github.com/alexschimpf/fastapi-versionizer/blob/ea5794f386cd6cf36b9db986cc672866eab11a1a/setup.py#L8

Your environment

Steps to reproduce

pip install fastapi-versionizer==1.0.0

Expected behaviour

The requirements.txt file should be included into the source distribution tarball file while building the package, or revert back to previous way of directly writing the library requirements in setup.py.

Note: same error will be thrown for package.json file as well, because it doesn't exist in the tarball either. https://github.com/alexschimpf/fastapi-versionizer/blob/ea5794f386cd6cf36b9db986cc672866eab11a1a/setup.py#L11

Actual behaviour

Collecting fastapi-versionizer
  Using cached fastapi_versionizer-1.0.0.tar.gz (5.0 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-zln8exx2/fastapi-versionizer_f0887aaa0a8244ac8589cd0f033e99c5/setup.py", line 8, in <module>
          with open('requirements.txt', 'r') as requirements_file:
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
alexschimpf commented 1 year ago

Ahh got it. I'll fix this today. Thanks for bringing this up.

alexschimpf commented 1 year ago

Ok should be fixed now in 1.0.1.

$ pip install fastapi-versionizer
>
Collecting fastapi-versionizer
  Downloading fastapi_versionizer-1.0.1.tar.gz (5.2 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: fastapi>=0.86.0 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from fastapi-versionizer) (0.103.1)
Requirement already satisfied: anyio<4.0.0,>=3.7.1 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from fastapi>=0.86.0->fastapi-versionizer) (3.7.1)
Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from fastapi>=0.86.0->fastapi-versionizer) (2.3.0)
Requirement already satisfied: starlette<0.28.0,>=0.27.0 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from fastapi>=0.86.0->fastapi-versionizer) (0.27.0)
Requirement already satisfied: typing-extensions>=4.5.0 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from fastapi>=0.86.0->fastapi-versionizer) (4.7.1)
Requirement already satisfied: idna>=2.8 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from anyio<4.0.0,>=3.7.1->fastapi>=0.86.0->fastapi-versionizer) (3.4)
Requirement already satisfied: sniffio>=1.1 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from anyio<4.0.0,>=3.7.1->fastapi>=0.86.0->fastapi-versionizer) (1.3.0)
Requirement already satisfied: exceptiongroup in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from anyio<4.0.0,>=3.7.1->fastapi>=0.86.0->fastapi-versionizer) (1.1.3)
Requirement already satisfied: annotated-types>=0.4.0 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi>=0.86.0->fastapi-versionizer) (0.5.0)
Requirement already satisfied: pydantic-core==2.6.3 in /Users/alexschimpf/.pyenv/versions/3.8.18/envs/fastapi-versionizer-3.8/lib/python3.8/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi>=0.86.0->fastapi-versionizer) (2.6.3)
Building wheels for collected packages: fastapi-versionizer
  Building wheel for fastapi-versionizer (setup.py) ... done
  Created wheel for fastapi-versionizer: filename=fastapi_versionizer-1.0.1-py3-none-any.whl size=7428 sha256=3bb270492a6c972698f19a1f00ce8335a676af4835e4b14a2f7f1a728064f8e2
  Stored in directory: /Users/alexschimpf/Library/Caches/pip/wheels/a7/e0/8f/03d638fdf6857c1f8930aee2e9a47dff62ffd4b26f11fb5c14
Successfully built fastapi-versionizer
Installing collected packages: fastapi-versionizer
Successfully installed fastapi-versionizer-1.0.1
AsifArmanRahman commented 1 year ago

Yeah, works fine. Keep on the great work!