Skip to content

Cannot install from sdist #78

@koniiiik

Description

@koniiiik

Attempting to install the latest version with current pip from sdist leads to the following error:

$ pip install --no-binary=:all: django-timezone-field==4.2.1 -vvv
[…]
Collecting django-timezone-field==4.2.1
  Created temporary directory: /tmp/pip-unpack-rn_pkd07
  Looking up "https://files.pythonhosted.org/packages/19/0c/92d0666a4372390284919080f49306986e29614756ff48b63b9bb6690c19/django-timezone-field-4.2.1.tar.gz" in the cache
  Current age based on date: 1611
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 1611
  Using cached django-timezone-field-4.2.1.tar.gz (8.9 kB)
  Added django-timezone-field==4.2.1 from https://files.pythonhosted.org/packages/19/0c/92d0666a4372390284919080f49306986e29614756ff48b63b9bb6690c19/django-timezone-field-4.2.1.tar.gz#sha256=97780cde658daa5094ae515bb55ca97c1352928ab554041207ad515dee3fe971 to build tracker '/tmp/pip-req-tracker-4rf2zvm7'
  Created temporary directory: /tmp/pip-build-env-q8z2wvtb
  Created temporary directory: /tmp/pip-standalone-pip-200_p119
  Running command /usr/local/bin/python /tmp/pip-standalone-pip-200_p119/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-q8z2wvtb/overlay --no-warn-script-location -v --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- 'poetry-core>=1.0.0'
  Using pip 21.2.4 from /tmp/pip-standalone-pip-200_p119/__env_pip__.zip/pip (python 3.8)
  Collecting poetry-core>=1.0.0
    Using cached poetry-core-1.0.7.tar.gz (346 kB)
    Getting requirements to build wheel: started
    Running command /usr/local/bin/python /tmp/tmpwupyjzgw get_requires_for_build_wheel /tmp/tmphxw7_q4a
    Getting requirements to build wheel: finished with status 'done'
      Preparing wheel metadata: started
      Running command /usr/local/bin/python /tmp/tmp6hhp3xnj prepare_metadata_for_build_wheel /tmp/tmptnr_0jsy
      Preparing wheel metadata: finished with status 'done'
  Building wheels for collected packages: poetry-core
    Building wheel for poetry-core (PEP 517): started
    Running command /usr/local/bin/python /tmp/tmp3hwc6xt8 build_wheel /tmp/tmp277z43ii
    Building wheel for poetry-core (PEP 517): finished with status 'done'
    Created wheel for poetry-core: filename=poetry_core-1.0.7-py2.py3-none-any.whl size=424762 sha256=e49b8e329c8973f0b88641ca0c96e61eb949c997c26a06113ba3c49ae50e8a2d
    Stored in directory: /root/.cache/pip/wheels/ba/e4/44/ea31b9805c00435905446469f726699e1c272aa5339fbe35a5
  Successfully built poetry-core
  Installing collected packages: poetry-core
  Successfully installed poetry-core-1.0.7
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  WARNING: You are using pip version 21.2.4; however, version 21.3 is available.
  You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
  Installing build dependencies ... done
  Running command /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpdl98aurd
  Getting requirements to build wheel ... done
    Created temporary directory: /tmp/pip-modern-metadata-dw2y8eoa
    Running command /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp1qbs2q9f
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
        main()
      File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 151, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-q8z2wvtb/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 44, in prepare_metadata_for_build_wheel
        builder = WheelBuilder(poetry)
      File "/tmp/pip-build-env-q8z2wvtb/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 57, in __init__
        super(WheelBuilder, self).__init__(poetry, executable=executable)
      File "/tmp/pip-build-env-q8z2wvtb/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/builder.py", line 85, in __init__
        self._module = Module(
      File "/tmp/pip-build-env-q8z2wvtb/overlay/lib/python3.8/site-packages/poetry/core/masonry/utils/module.py", line 63, in __init__
        raise ModuleOrPackageNotFound(
    poetry.core.masonry.utils.module.ModuleOrPackageNotFound: No file/folder found for package django-timezone-field
    Preparing wheel metadata ... error

According to the docs for poetry, since the Python package name does not match the pypi name, it needs to be customized with

packages = [
    { include = "timezone_field" },
]

in the [tool.poetry] section of pyproject.toml.

However, I don't have enough experience with poetry to know whether this is enough to pull in all the required files that you expect to have in wheels, or not.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions