Closed conradtchan closed 1 year ago
pip install git+https://github.com/conradtchan/starfit.git@99c7960ba740d71d2ac29f70087119255e00c98a
...
ModuleNotFoundError: No module named 'mesonpy'
maybe requires extra dependency?
but there is no module named mesonpy
:
~/python>pip install mesonpy
Collecting mesonpy
Downloading MesonPy-0.0.1.tar.gz (14 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 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/n4/g1v3m0sn78lb3cyjqfhm3yh40000gn/T/pip-install-cc7dwhqy/mesonpy_704bfd5d7c134b39bc525215882dc8b0/setup.py", line 4, in <module>
with open('requirements.txt') as f:
^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
[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.
meson-python
ERROR: Could not detect Ninja v1.8.2 or newer
brew install ninja
Successfully installed starfit-0.0.0
This was for M1 (MacOS 13.1, homebrew)
The issue with failed version number for dev versions seems to persist with meson. But I do not recall whether this was an issue with setuptools or something else in the first place.
@2sn That's strange. Something is wrong if you manually need to install meson and ninja. The build requirements in pyproject.toml should get those automatically. The command:
pip install git+https://github.com/conradtchan/starfit.git@99c7960ba740d71d2ac29f70087119255e00c98a
works for me in a clean environment.
no, this did not work on my mac with homebrew.
I mean, it compiled after I manually installed the packages. On my linux machine I already have ninja installed (to compile vtk).
@conradtchan How do I install editable build?
~/python/starfit>pip install -U -e .[testing]
Obtaining file:///home/alex/python/starfit
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.21 in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (1.24.1)
Requirement already satisfied: scipy in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (1.10.0)
Requirement already satisfied: matplotlib in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (3.6.3)
Requirement already satisfied: setuptools in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (65.5.0)
Requirement already satisfied: psutil in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (5.9.4)
Requirement already satisfied: pyyaml in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (6.0)
Requirement already satisfied: pytest in /home/alex/Python/lib/python3.11/site-packages (from starfit==0.0.0) (7.2.1)
Requirement already satisfied: contourpy>=1.0.1 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (1.0.7)
Requirement already satisfied: cycler>=0.10 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (4.38.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (1.4.4)
Requirement already satisfied: packaging>=20.0 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (23.0)
Requirement already satisfied: pillow>=6.2.0 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (9.4.0)
Requirement already satisfied: pyparsing>=2.2.1 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in /home/alex/Python/lib/python3.11/site-packages (from matplotlib->starfit==0.0.0) (2.8.2)
Requirement already satisfied: attrs>=19.2.0 in /home/alex/Python/lib/python3.11/site-packages (from pytest->starfit==0.0.0) (22.2.0)
Requirement already satisfied: iniconfig in /home/alex/Python/lib/python3.11/site-packages (from pytest->starfit==0.0.0) (2.0.0)
Requirement already satisfied: pluggy<2.0,>=0.12 in /home/alex/Python/lib/python3.11/site-packages (from pytest->starfit==0.0.0) (1.0.0)
Requirement already satisfied: six>=1.5 in /home/alex/Python/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->starfit==0.0.0) (1.16.0)
Installing collected packages: starfit
Attempting uninstall: starfit
Found existing installation: starfit 0.18.0.post1.dev0+gdfe9039.d20221211
Uninstalling starfit-0.18.0.post1.dev0+gdfe9039.d20221211:
Successfully uninstalled starfit-0.18.0.post1.dev0+gdfe9039.d20221211
Running setup.py develop for starfit
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of starfit
Moving to /home/alex/Python_3.11.0/lib/python3.11/site-packages/starfit.egg-link
from /tmp/pip-uninstall-jpt7jn8o/starfit.egg-link
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
@2sn what is your pip --version
?
should be current (updated yesterday)
pip 22.3.1 from /home/alex/Python/lib/python3.11/site-packages/pip (python 3.11)
Installed on my Linux as regular package, just need to know about editable install.
Maybe mesone version should be a branch not on the main distribution for now?
We need to implement editable installs (https://peps.python.org/pep-0660/) before this PR is ready. Switching this back to a draft.
@2sn When we were using setup.py, what happens when you edit the fortran source in an editable install? does it recompile, or ignore those changes?
@conradtchan I ran ran the editable install command again and it re-compiled. It did not do that automatically (unlike my build.py
).
@2sn meson-python doesn't support editable installs yet. It's in the next release though: https://github.com/mesonbuild/meson-python/milestone/6
@2sn Builds and installs correctly on the web server.
@conradtchan it seems this is now ready to merge? Please go ahead!
@conradtchan now I have to learn how to use the new build system if I change anything ...
Resolves #162
numpy.distutils will be removed in Python 3.12: https://numpy.org/doc/stable/reference/distutils_status_migration.html
Migration to another build system is necessary to build Fortran components. Meson is chosen based on the recommendations. It is likely to be well supported because it is used by SciPy.
Previously, the version number was set automatically using setuptools_scm from the git tag. In Meson, this is done using
in the release step. This was tested in https://github.com/conradtchan/starfit/releases/tag/0.19.1.dev0
This PR also removes setup.cfg, moving all of the config into pyproject.toml