dan-fritchman / Hdl21

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

BUG: sky130 pdk pypi Install #218

Closed curtisma closed 1 month ago

curtisma commented 2 months ago

When I try to install the sky130 pdk I receive the following error due to it not being able to find the readme. Here I have "sky130-hdl21 == 5.0.0" as a dependency in the pyproject.toml of my "bandgaps" project and am trying to do an editable install of bandgaps.

I would propose that we convert the sky130-hdl21 pdk package to use a pyproject.toml to define the metadata and build the project using flit.

This would have a simpler definition than the currernt setup.py and handles problems where the package is a zip rather than an actual path.

image

dan-fritchman commented 2 months ago

Looks like that happens with pip too:

$ pip install sky130-hdl21==5.0
Collecting sky130-hdl21==5.0
  Using cached sky130-hdl21-5.0.0.tar.gz (50 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
        File "/private/var/folders/2t/c78725w17pb1bcxb9t3k17wc0000gn/T/pip-install-m8ad3bea/sky130-hdl21_1398dbc2b5714fca8b2684a328ce72e9/setup.py", line 16, in <module>
          long_description = (here / "readme.md").read_text(encoding="utf-8")
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/2t/c78725w17pb1bcxb9t3k17wc0000gn/T/pip-install-m8ad3bea/sky130-hdl21_1398dbc2b5714fca8b2684a328ce72e9/readme.md'
      [end of output]

(Guess everyone has been using this from source instead of PyPi.)

And if you just download the tar-ball from PyPi here: https://pypi.org/project/sky130-hdl21/#files It doesn't include the README.
Which is specifically a problem because, the setup-script reads the README.

That is extra weird because... PyPi clearly has the README?
It renders it right here on the project page?
https://pypi.org/project/sky130-hdl21/

image

The main Hdl21 package in fact added a check for this once upon a time (here); seems the PDK packages did not.

So:

But - PRs for either or both welcome!
We have a release pending, primarily for #157, so it's a great time for em.

curtisma commented 2 months ago

Awesome I submitted PR #219 which addresses both issues.

It renders it right here on the project page?

Yeah, it might upload that seperately as part of the publish api.

Not sure I totally follow how they relate. On the theory that the family of TOML-tools is better at not screwing this up?

The pyproject.toml reads the readme from the specified file by default.