Skip to content
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
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ on:
- 'src/**'
- 'tests/**'
- '.clang-format'
- 'MANIFEST.in'
- 'meson.build'
- 'pyproject.toml'
- 'setup.py'
workflow_dispatch:

jobs:
Expand All @@ -29,11 +28,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: |
pip install -v .[cov] && pytest
pip install -Cbuild-dir=build -Ccompile-args=-v -Csetup-args=-Db_coverage=true -v .[cov] && pytest
gcovr --json-summary-pretty | tee coverage.json
[ $(jq '.line_percent*10' coverage.json) -ge 950 ]
env:
CXXFLAGS: --coverage
- uses: stellarhub/push-gist-action@v1
with:
token: ${{ secrets.PAT }}
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/.idea/
/build/
/cov/
/dist/
/docs/_build/
/docs/_static/fonts/
/docs/_static/images/
/src/pysorteddict.egg-info/
/tests/performance/.ipynb_checkpoints/

__pycache__
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

29 changes: 29 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project('pysorteddict', 'cpp')

source_directory = 'src/pysorteddict/'
source_files = files(
source_directory + 'sorted_dict_items_type.cc',
source_directory + 'sorted_dict_keys_type.cc',
source_directory + 'sorted_dict_module.cc',
source_directory + 'sorted_dict_type.cc',
source_directory + 'sorted_dict_values_type.cc',
source_directory + 'sorted_dict_view_type.cc',
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggestion

It may be possible to use the division operator to concatenate paths.

)

cpp_args = ['-std=c++20']
link_args = []
if get_option('b_coverage')
cpp_args += ['-O0']
else
cpp_args += ['-flto']
link_args += ['-flto']
Copy link
Owner Author

Choose a reason for hiding this comment

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

Important

Use MSVC on Windows. Looks like it’s using the MinGW compiler which might be incompatible with CPython.

endif

py = import('python').find_installation(pure: false)
py.extension_module(
'pysorteddict',
source_files,
cpp_args: cpp_args,
link_args: link_args,
install: true,
)
27 changes: 7 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
[build-system]
requires = [
# See https://github.com/pypa/cibuildwheel/issues/2015. The macOS linker
# receives an unrecognised flag when building a PyPy 3.10 wheel if a
# different version is used.
"setuptools==72.1.0; platform_system == 'Darwin' and platform_python_implementation == 'PyPy'",
# See https://github.com/pypa/cibuildwheel/issues/2676. The Windows linker
# can't find the static Python library file when building a CPython 3.14t
# wheel if the above version is used. In newer versions, licence
# classifiers are deprecated. Hence, find a middle ground.
"setuptools<=76.1.0",
]
build-backend = "setuptools.build_meta"
requires = ["meson-python"]
build-backend = "mesonpy"

[dependency-groups]
docs = ["furo~=2024.8", "myst-parser~=4.0"]
Expand Down Expand Up @@ -66,13 +56,13 @@ dev-mode = false
detached = true
features = ["cov"]

[tool.hatch.envs.cov.env-vars]
CXXFLAGS = "--coverage"

[tool.hatch.envs.cov.scripts]
# To measure the coverage of C++ code, the build directory must persist,
# because the coverage files are supposed to be read in tandem with the object
# files.
cov = [
"rm -fr build/ cov/ && pip install . && pytest",
"mkdir -p cov/ && gcovr --html-details cov/index.html",
"rm -fr build/ cov/ && pip install -Cbuild-dir=build -Csetup-args=-Db_coverage=true -q . && pytest",
"mkdir cov/ && gcovr --html-details cov/index.html",
]

[tool.hatch.envs.docs]
Expand All @@ -97,6 +87,3 @@ line-length = 119
"docs/conf.py" = ["A001", "INP001"]
"examples/*" = ["S101", "T201"]
"tests/functional/*" = ["S101", "S311"]

[tool.setuptools]
include-package-data = false
23 changes: 0 additions & 23 deletions setup.py

This file was deleted.

Loading