Question about using a front end like PDM with meson-python #273
-
Hi there! @eli-schwartz i'm following up on our convos in the open PR i'm working on surrounding packaging. I've been playing with meson and am having some success so far with pure python builds. I am now playing around with swapping out backends using PDM. In the above repo is this a question i should be asking the PDM dev instead? the output below shows the error which seems to be it can't find the SDist in the dist directory. i just am not sure how to best approach using these tools together.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I debugged this and I think it's 3 different bugs combined:
|
Beta Was this translation helpful? Give feedback.
-
I have now merged the fix. |
Beta Was this translation helpful? Give feedback.
-
hi @eli-schwartz @FFY00 I have had some success with using pdm with meson-python on a basic build. I've run into another curious issue. my branch where i'm working is here: When i install a dependency with PDM, it installs examplePy in editable mode as expected. All packages are synced to date, nothing to do.
Installing the project as an editable package...
✔ Install examplePy 0.1.00 successful But what is odd is when i use
I see this same behavior in the python console when i print out a list of packages. >>> import pkg_resources
>>> installed_packages = pkg_resources.working_set
>>> installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
... for i in installed_packages])
>>> print(installed_packages_list)
[... 'meson-python==0.12.0', 'meson==1.0.0', 'packaging==23.0', 'pdm-pep517==1.0.6', 'pdm==2.4.0', 'pep517==0.13.0', 'pip==22.3.1',... 'requests==2.28.2', 'resolvelib==0.9.0', 'rich==13.3.0', 'setuptools==65.6.3', ... 'unknown==0.0.0'] So finally i thought.- perhaps i can just do a simple pip editable install. this doesn't work.
What does build however is this: pip install --no-build-isolation . When i install the package that way, i see it in the conda list output correctly - examplePy is listed with the correct version. And i can check it in my python console when i list packages and confirm it is there. i am in the correct environment in python too:
but the package won't import. >>> print(installed_packages_list)
[... 'distlib==0.3.6', 'examplepy==0.1.0', ... 'meson-python==0.12.0', 'meson==1.0.0', 'msgpack==1.0.3', 'packaging==23.0', 'pdm-pep517==1.0.6', 'pdm==2.4.0', 'pep517==0.13.0', 'pip==22.3.1',...]
>>> import examplepy # just in case something is case sensitive in a way i don't know it is
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'examplepy'
>>> import examplePy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'examplePy'
>>>
>>> import os
>>> print(os.environ['CONDA_DEFAULT_ENV'])
pdm_meson i am not sure here whether this is PDM, meson-python or me just not understanding how the build should work. the goal here is installing my package in editable mode. |
Beta Was this translation helpful? Give feedback.
I debugged this and I think it's 3 different bugs combined:
build
does#274