dan-fritchman / Hdl21

Hardware Description Library
BSD 3-Clause "New" or "Revised" License
67 stars 15 forks source link

v3.0 Readme didn't get uploaded to PyPi #100

Closed dan-fritchman closed 1 year ago

dan-fritchman commented 1 year ago

It looks like twine, or setuptools, or pypi, or something in that pipeline recently changed what gets uploaded in distribution tarballs by default. Hdl21 v3.0 was recently released to PyPi, but can't actually be installed from there because it lacks its README file.

Now, one not necessarily need a README to be installed as a Python package... but ours has this line in setup.py:

          long_description = (here / "readme.md").read_text(encoding="utf-8")

And setup.py needs to run to completion for pip-based installation.
So, you get this:

$ pip install hdl21==3.0.0
Collecting hdl21==3.0.0
  Using cached hdl21-3.0.tar.gz (151 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 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-gez1jlfw/hdl21_e6031de78f154f5eae5b88cdc78d029c/setup.py", line 16, in <module>
          long_description = (here / "readme.md").read_text(encoding="utf-8")
        File "/usr/lib/python3.9/pathlib.py", line 1255, in read_text
          with self.open(mode='r', encoding=encoding, errors=errors) as f:
        File "/usr/lib/python3.9/pathlib.py", line 1241, in open
          return io.open(self, mode, buffering, encoding, errors, newline,
        File "/usr/lib/python3.9/pathlib.py", line 1109, in _opener
          return self._accessor.open(self, flags, mode)
      FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-gez1jlfw/hdl21_e6031de78f154f5eae5b88cdc78d029c/readme.md'
      [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.

[notice] A new release of pip is available: 23.0 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
dan-fritchman commented 1 year ago

The other fun thing about this is: PyPi clearly has the README; it renders it in full, here: https://pypi.org/project/hdl21/3.0/

But the distribution tarball doesn't include it.

dan-fritchman commented 1 year ago

Newly release v3.0.1 corrects this. https://pypi.org/project/hdl21/3.0.1/ The sole difference is the version string: 3.0 => 3.0.1.

It's not really clear what went wrong. Notably v3.0.0 was the first (and probably last) release done from one of our cloud-project machines. Building and publishing from my local laptop cured it.

Also noting this effected the whole "VLSIR family" of Python packages (vlsir, vlisrtools, et al). They all have busted 3.0.0 releases, and new v3.0.1 releases.