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

Relax meson pins in CI #60681

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
command: |
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python meson[ninja]
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
python -m pip install --no-cache-dir --no-build-isolation -e . -Csetup-args="--werror"
python -m pip list --no-cache-dir
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer
- cython>=0.29.33
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:
# build dependencies
- versioneer
- cython>=0.29.33
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ dependencies:

# build dependencies
- versioneer
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1
- cython>=0.29.33

# test dependencies
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311-pyarrownightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dependencies:

# build dependencies
- versioneer
- meson=1.2.1
- meson>=1.2.1
- cython>=0.29.33
- meson-python=0.13.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer
- cython>=0.29.33
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-312.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer
- cython>=0.29.33
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/actions-pypy-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
# build dependencies
- versioneer
- cython>=0.29.33
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions ci/deps/circle-311-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies:
# build dependencies
- versioneer
- cython>=0.29.33
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ dependencies:
# build dependencies
- versioneer
- cython~=3.0.5
- meson=1.2.1
- meson-python=0.13.1
- meson>=1.2.1
- meson-python>=0.13.1

# test dependencies
- pytest>=7.3.2
Expand Down
29 changes: 18 additions & 11 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,26 @@ py = import('python').find_installation(pure: false)
tempita = files('generate_pxi.py')
versioneer = files('generate_version.py')


add_project_arguments('-DNPY_NO_DEPRECATED_API=0', language: 'c')
add_project_arguments('-DNPY_NO_DEPRECATED_API=0', language: 'cpp')

# Allow supporting older numpys than the version compiled against
# Set the define to the min supported version of numpy for pandas
# e.g. right now this is targeting numpy 1.21+
add_project_arguments('-DNPY_TARGET_VERSION=NPY_1_21_API_VERSION', language: 'c')
add_project_arguments(
cc = meson.get_compiler('c')
cp = meson.get_compiler('cpp')

project_args = [
'-DNPY_NO_DEPRECATED_API=0',
# Allow supporting older numpys than the version compiled against
# Set the define to the min supported version of numpy for pandas
# e.g. right now this is targeting numpy 1.21+
'-DNPY_TARGET_VERSION=NPY_1_21_API_VERSION',
language: 'cpp',
)
# ignore some MSVC warnings for narrowing
'/wd4244',
'/wd4267',
'/wd4551',
]

c_args = cc.get_supported_arguments(project_args)
cpp_args = cp.get_supported_arguments(project_args)

add_project_arguments(c_args, language: 'c')
add_project_arguments(cpp_args, language: 'cpp')

if fs.exists('_version_meson.py')
py.install_sources('_version_meson.py', subdir: 'pandas')
Expand Down
9 changes: 9 additions & 0 deletions pandas/_libs/hashtable_func_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ cdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna, const uint8
result_counts[i] = table.vals[k]

if na_counter > 0:
# gcc-11.4 on ubuntu 22.04 cannot see that val won't be unassigned
# when we make it into this branch
assert n > 0
{{if dtype == 'object'}}
val = values[n - 1]
{{else}}
val = {{to_c_type}}(values[n - 1])
{{endif}}

result_counts[table.size] = na_counter
result_keys.append(val)

Expand Down
13 changes: 11 additions & 2 deletions pandas/_libs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ libs_sources = {
'sources': ['join.pyx', _khash_primitive_helper],
'deps': _khash_primitive_helper_dep,
},
'lib': {'sources': ['lib.pyx', 'src/parser/tokenizer.c']},
'lib': {
'sources': ['lib.pyx', 'src/parser/tokenizer.c'],
# cython issue 6603
'c_args': cc.get_supported_arguments(['-Wno-unused-function']),
},
'missing': {'sources': ['missing.pyx']},
'pandas_datetime': {
'sources': [
Expand Down Expand Up @@ -117,7 +121,11 @@ libs_sources = {
'ops': {'sources': ['ops.pyx']},
'ops_dispatch': {'sources': ['ops_dispatch.pyx']},
'properties': {'sources': ['properties.pyx']},
'reshape': {'sources': ['reshape.pyx']},
'reshape': {
'sources': ['reshape.pyx'],
# cython issue 6603
'c_args': cc.get_supported_arguments(['-Wno-unused-function']),
},
'sas': {'sources': ['sas.pyx']},
'byteswap': {'sources': ['byteswap.pyx']},
'sparse': {'sources': ['sparse.pyx', _sparse_op_helper]},
Expand All @@ -142,6 +150,7 @@ foreach ext_name, ext_dict : libs_sources
cython_args: cython_args,
include_directories: [inc_np, inc_pd],
dependencies: ext_dict.get('deps', ''),
c_args: ext_dict.get('c_args', []),
subdir: 'pandas/_libs',
install: true,
)
Expand Down
5 changes: 4 additions & 1 deletion pandas/io/formats/style_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Sequence,
)
from functools import partial
import pathlib
import re
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -71,7 +72,9 @@ class StylerRenderer:
Base class to process rendering a Styler with a specified jinja2 template.
"""

loader = jinja2.PackageLoader("pandas", "io/formats/templates")
thisdir = pathlib.Path(__file__).parent.resolve()
template_dir = thisdir / "templates"
loader = jinja2.FileSystemLoader(template_dir)
env = jinja2.Environment(loader=loader, trim_blocks=True)
template_html = env.get_template("html.tpl")
template_html_table = env.get_template("html_table.tpl")
Expand Down
5 changes: 4 additions & 1 deletion pandas/tests/io/formats/style/test_html.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pathlib
from textwrap import (
dedent,
indent,
Expand All @@ -18,7 +19,9 @@

@pytest.fixture
def env():
loader = jinja2.PackageLoader("pandas", "io/formats/templates")
project_dir = pathlib.Path(__file__).parent.parent.parent.parent.parent.resolve()
template_dir = project_dir / "io" / "formats" / "templates"
loader = jinja2.FileSystemLoader(template_dir)
env = jinja2.Environment(loader=loader, trim_blocks=True)
return env

Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
requires = [
"meson-python>=0.13.1",
"meson>=1.2.1,<2",
"meson>=1.2.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the <2 as I didn't want to repeat it everywhere in our CI configurations, and we don't create upper bounds like this on any other dependency. There also is not a meson 2.0 under development

"wheel",
"Cython~=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json
# Force numpy higher than 2.0rc1, so that built wheels are compatible
Expand Down Expand Up @@ -149,7 +149,6 @@ setup = ['--vsenv'] # For Windows
[tool.cibuildwheel]
skip = "cp36-* cp37-* cp38-* cp39-* pp* *_i686 *_ppc64le *_s390x"
build-verbosity = "3"
environment = {LDFLAGS="-Wl,--strip-all"}
test-requires = "hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0"
test-command = """
PANDAS_CI='1' python -c 'import pandas as pd; \
Expand All @@ -159,6 +158,12 @@ test-command = """
free-threaded-support = true
before-build = "PACKAGE_DIR={package} bash {package}/scripts/cibw_before_build.sh"

[tool.cibuildwheel.macos]
environment = {LDFLAGS="-Wl,--strip-all"}
Copy link
Member Author

Choose a reason for hiding this comment

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

These flags are not applicable on windows and were causing the linker to throw an error when combined with -Werror in our CI


[tool.cibuildwheel.linux]
environment = {LDFLAGS="-Wl,--strip-all"}

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel && bash {package}/scripts/cibw_before_build_windows.sh"
before-test = "bash {package}/scripts/cibw_before_test_windows.sh"
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pip
versioneer[toml]
cython~=3.0.5
meson[ninja]==1.2.1
meson-python==0.13.1
meson[ninja]>=1.2.1
meson-python>=0.13.1
pytest>=7.3.2
pytest-cov
pytest-xdist>=3.4.0
Expand Down
Loading