Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PEP517 #20

Merged
merged 2 commits into from
Jun 2, 2023
Merged

Support PEP517 #20

merged 2 commits into from
Jun 2, 2023

Conversation

glaserL
Copy link
Contributor

@glaserL glaserL commented May 18, 2023

First of all thank you for your package!

The issue

On PyPi there is no wheel for python 3.10, so pip tries to build from source when i do pip install rdflib-hdt, which results in an error, No module named 'pybind11'.

Open Full Log
Collecting rdflib-hdt
  Downloading rdflib_hdt-3.0.tar.gz (235 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235.6/235.6 kB 1.2 MB/s eta 0:00:00
  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 "/private/var/folders/np/78qcb3_56h7g7tvd3z9vk_1h0000gn/T/pip-install-s2u617xp/rdflib-hdt_30c06c8253134e28b307059c38a61684/setup.py", line 5, in <module>
          import pybind11
      ModuleNotFoundError: No module named 'pybind11'
      [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.

The solution

The pyproject.toml file defines the build requirements for PEP517. Therefore pip (or any other package manager like poetry) installs the build requirements before building itself.

Test

I tested this by installing from the fork (pip install git+https://github.com/glaserL/rdflib-hdt), which works well.

Open Full Log
Collecting git+https://github.com/glaserL/rdflib-hdt
  Cloning https://github.com/glaserL/rdflib-hdt to /private/var/folders/np/78qcb3_56h7g7tvd3z9vk_1h0000gn/T/pip-req-build-dr5jn5ep
  Running command git clone --filter=blob:none --quiet https://github.com/glaserL/rdflib-hdt /private/var/folders/np/78qcb3_56h7g7tvd3z9vk_1h0000gn/T/pip-req-build-dr5jn5ep
  Resolved https://github.com/glaserL/rdflib-hdt to commit 1bee1a766df3ba5e7b5a842c2ab7152bb89a89ce
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pybind11>=2.2.4
  Using cached pybind11-2.10.4-py3-none-any.whl (222 kB)
Collecting rdflib>=4.2
  Downloading rdflib-6.3.2-py3-none-any.whl (528 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 528.1/528.1 kB 1.3 MB/s eta 0:00:00
Collecting pyparsing<4,>=2.1.0
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 1.1 MB/s eta 0:00:00
Collecting isodate<0.7.0,>=0.6.0
  Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.7/41.7 kB 748.1 kB/s eta 0:00:00
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: rdflib-hdt
  Building wheel for rdflib-hdt (pyproject.toml) ... done
  Created wheel for rdflib-hdt: filename=rdflib_hdt-3.0-cp310-cp310-macosx_10_9_x86_64.whl size=479092 sha256=ba64f58a82da14962560349eefd50581902994b62d214fc55b4c5c1a631596ad
  Stored in directory: /private/var/folders/np/78qcb3_56h7g7tvd3z9vk_1h0000gn/T/pip-ephem-wheel-cache-0s630etk/wheels/f7/b5/68/f1fb13e6fbf1c16d856f6ed7465f80bba03966faa60f0dcbb7
Successfully built rdflib-hdt
Installing collected packages: six, pyparsing, pybind11, isodate, rdflib, rdflib-hdt
Successfully installed isodate-0.6.1 pybind11-2.10.4 pyparsing-3.0.9 rdflib-6.3.2 rdflib-hdt-3.0 six-1.16.0

Copy link
Collaborator

@Callidon Callidon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution 👍 Apart from small comment on code cleanup and on a file to delete, it's looking good to me. I've tested an install through pip and it works like a charm 👌

setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
build-release.sh Outdated Show resolved Hide resolved
@glaserL
Copy link
Contributor Author

glaserL commented May 23, 2023

Thank you very much for your review!
I updated the PR within the fixup commit, If you are fine with them I will squash them :)

@glaserL
Copy link
Contributor Author

glaserL commented Jun 2, 2023

I'm unsure if I missed a step in the process, can I squash the fixup commit?

@Callidon
Copy link
Collaborator

Callidon commented Jun 2, 2023

I'm unsure if I missed a step in the process, can I squash the fixup commit?

Sorry, I was quite busy last weeks, I forgot to reply. I will handle the release, your PR is good to go, thank you!

@Callidon Callidon merged commit b6b5860 into RDFLib:master Jun 2, 2023
2 checks passed
@Callidon
Copy link
Collaborator

Callidon commented Jun 2, 2023

@glaserL I've released the new version as v3.1, can tell me if everything is installing correctly on your side?

@glaserL
Copy link
Contributor Author

glaserL commented Jun 2, 2023

Oh I'm so sorry the fixup commit is still in the history, I am used to get that approved and then everything gets squashed. I hope no one looks into the history.

Works like a charm, thank you very much!

@Callidon
Copy link
Collaborator

Callidon commented Jun 2, 2023

Oh I'm so sorry the fixup commit is still in the history, I am used to get that approved and then everything gets squashed. I hope no one looks into the history.

No big deal, I don't think anyone will be annoyed about that 😁

Works like a charm, thank you very much!

Great, one good thing done 🚀 Thank you for your contribution 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants