-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BLD: Setup meson builds #49115
BLD: Setup meson builds #49115
Changes from all commits
a5b2572
7191763
65be7cc
e5805fc
2e89b1f
66346a4
e267f87
545a91a
f85bd93
8896002
399a93f
d01fe1a
9b64577
0de3320
a26c9dd
cf24f5d
c5cbcab
f56d1d4
24d07c2
8ceb278
7d26fca
796d4c4
d2764ef
ec386f7
069e76e
9068490
6d18625
496294c
2e642e8
2157f06
f1555ee
057ea20
beeab2a
4ecbb41
e4c5933
d00d35a
a823304
073e371
55f7ec8
5c5a0ac
5570d9b
2b5505e
a7a2e6f
6ef5a18
9fd9d2b
782a8c7
3dae633
f86b11a
d7a7bf1
597dd67
aa94fc7
77ed403
a2a8361
a01aee8
b0a2093
c2291dc
6663d31
094957d
4fe3ec0
0ee732d
6291b9b
f6422e5
e1f750e
f36e014
6ed4572
792c9eb
d64acbf
de5c42f
a862508
320a64b
a7f973a
fe904c5
1bdedc6
9e1ccc2
09c573d
9c63bb1
a3e7ba2
7a5e1d8
7f6afda
b9e9087
9592429
cc89d18
c228822
cd38f4c
3136cc5
93f6e86
b8be6a4
12617c0
6d088dd
23c2aaa
3d92e2b
3b6bc5c
61e4172
cd5137c
65bba29
7225844
e6133df
dd46921
9142148
cf67679
5213192
3881827
2306dd5
e8389ca
dc9d5f1
1ff6c41
41ef248
98600cc
e34480a
fe03652
b513ee8
00fd024
f854c02
6270a2a
035df6b
a3e59fa
1bfd61e
ae67059
70a43bb
996b93c
432cd42
cda4d05
62fa12c
4df819c
46845d5
58895b2
d9d1658
28237d9
7774dea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,13 +207,47 @@ for :ref:`building pandas with GitPod <contributing-gitpod>`. | |
Step 3: build and install pandas | ||
-------------------------------- | ||
|
||
You can now run:: | ||
There are currently two supported ways of building pandas, pip/meson and setuptools(setup.py). | ||
Historically, pandas has only supported using setuptools to build pandas. However, this method | ||
requires a lot of convoluted code in setup.py and also has many issues in compiling pandas in parallel | ||
due to limitations in setuptools. | ||
|
||
The newer build system, invokes the meson backend through pip (via a `PEP 517 <https://peps.python.org/pep-0517/>`_ build). | ||
It automatically uses all available cores on your CPU, and also avoids the need for manual rebuilds by | ||
rebuilding automatically whenever pandas is imported(with an editable install). | ||
|
||
For these reasons, you should compile pandas with meson. | ||
Because the meson build system is newer, you may find bugs/minor issues as it matures. You can report these bugs | ||
`here <https://github.com/pandas-dev/pandas/issues/49683>`_. | ||
|
||
To compile pandas with meson, run:: | ||
|
||
# Build and install pandas | ||
# The number after -j is the number of compiling jobs run in parallel | ||
# Change it according to your machine's hardware spec | ||
python setup.py build_ext -j 4 | ||
python -m pip install -e . --no-build-isolation --no-use-pep517 | ||
python -m pip install -ve . --no-build-isolation | ||
|
||
** Build options ** | ||
|
||
It is possible to pass options from the pip frontend to the meson backend if you would like to configure your | ||
install. Occasionally, you'll want to use this to adjust the build directory, and/or toggle debug/optimization levels. | ||
|
||
You can pass a build directory to pandas by appending ``--config-settings builddir="your builddir here"`` to your pip command. | ||
This option allows you to configure where meson stores your built C extensions, and allows for fast rebuilds. | ||
|
||
Sometimes, it might be useful to compile pandas with debugging symbols, when debugging C extensions. | ||
Appending ``--config-settings setup-args="-Ddebug=true"`` will do the trick. | ||
|
||
With pip, it is possible to chain together multiple config settings (for example specifying both a build directory | ||
and building with debug symbols would look like | ||
``--config-settings builddir="your builddir here" --config-settings=setup-args="-Dbuildtype=debug"``. | ||
|
||
**Compiling pandas with setup.py** | ||
|
||
.. note:: | ||
This method of compiling pandas will be deprecated and removed very soon, as the meson backend matures. | ||
|
||
To compile pandas with setuptools, run:: | ||
|
||
python setup.py develop | ||
|
||
.. note:: | ||
You will need to repeat this step each time the C extensions change, for example | ||
|
@@ -226,5 +260,22 @@ At this point you should be able to import pandas from your locally built versio | |
>>> print(pandas.__version__) # note: the exact output may differ | ||
2.0.0.dev0+880.g2b9e661fbb.dirty | ||
|
||
This will create the new environment, and not touch any of your existing environments, | ||
nor any existing Python installation. | ||
When building pandas with meson, importing pandas will automatically trigger a rebuild, even when C/Cython files are modified. | ||
By default, no output will be produced by this rebuild (the import will just take longer). If you would like to see meson's | ||
output when importing pandas, you can set the environment variable ``MESONPY_EDTIABLE_VERBOSE``. For example, this would be:: | ||
|
||
# On Linux/macOS | ||
MESONPY_EDITABLE_VERBOSE=1 python | ||
|
||
# Windows | ||
set MESONPY_EDITABLE_VERBOSE=1 # Only need to set this once per session | ||
python | ||
|
||
If you would like to see this verbose output every time, you can set the ``editable-verbose`` config setting to ``true`` like so:: | ||
|
||
python -m pip install -ve . --config-settings editable-verbose=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not work with meson 1.0.0
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, what version of meson-python are you using? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I already installed from meson main. No change when reinstalling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
output from pip freeze There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still outstanding? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for not getting back on this. This works for me on macOS. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works with 0.13.1 indeed, it can be resolved now. Editable support was added in 0.13.0 - the whole implementation changed after the Jan 4 comments. |
||
|
||
.. tip:: | ||
If you ever find yourself wondering whether setuptools or meson was used to build your pandas, | ||
you can check the value of ``pandas._built_with_meson``, which will be true if meson was used | ||
to compile pandas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, pytest-cov hasn't released anything since September sadly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm do you know why we are seeing this DeprecationWarning which changing to meson? (just curious, not a blocker)