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

Move to pyproject.toml config + use "python -m build -w" to build wheel #912

Open
wants to merge 3 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
8 changes: 4 additions & 4 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- name: Build wheel
run: |
python3 setup.py bdist_wheel
python3 -m build --wheel
auditwheel repair dist/*.whl

- name: Install wheel
Expand Down Expand Up @@ -109,13 +109,13 @@ jobs:
name: darwin,
os: macos-13,
macosx_deployment_target: "10.16", # to ensure pip finds wheel when Big Sur is configured to return 10.16 as version instead of 11.0
bdist_wheel_args: "--plat-name macosx-11.0-x86_64", # needed to avoid the wheel to be named -universal2
bdist_wheel_args: "--config-setting plat-name=macosx-11.0-x86_64", # needed to avoid the wheel to be named -universal2
}
- {
name: darwin-arm64,
os: macos-14,
macosx_deployment_target: "11", # first arm64 version of macosx
bdist_wheel_args: "--plat-name macosx-11.0-arm64", # needed to avoid the wheel to be named -universal2
bdist_wheel_args: "--config-setting plat-name=macosx-11.0-arm64", # needed to avoid the wheel to be named -universal2
}
- {
name: windows,
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- name: Build wheel
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.macosx_deployment_target }}
run: python setup.py bdist_wheel ${{ matrix.config.bdist_wheel_args }}
run: python -m build --wheel ${{ matrix.config.bdist_wheel_args }}

- name: Install wheel
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Build wheel
run: |
python3 setup.py bdist_wheel
python3 -m build --wheel
auditwheel repair dist/*.whl

- name: Install wheel
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
- name: Build wheel
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.macosx_deployment_target }}
run: python setup.py bdist_wheel ${{ matrix.config.bdist_wheel_args }}
run: python -m build --wheel ${{ matrix.config.bdist_wheel_args }}

- name: Install wheel
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- name: Build wheel
run: |
python3 setup.py bdist_wheel
python3 -m build --wheel
auditwheel repair dist/*.whl

- name: Install wheel
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
- name: Build wheel
env:
MACOSX_DEPLOYMENT_TARGET: "10.16" # to ensure pip finds wheel when Big Sur is configured to return 10.16 as version instead of 11.0
run: python setup.py bdist_wheel
run: python -m build --wheel

- name: Install wheel
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
run: pip3 install -r requirements.txt
working-directory: ./pypowsybl
- name: Build wheel
run: python3 setup.py bdist_wheel
run: python3 -m build --wheel
working-directory: ./pypowsybl
- name: Install wheel
run: python -m pip install dist/*.whl --user
Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[build-system]
requires = ["setuptools", "pybind11[global]==2.13.6", "cmake>=3.14"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]

[tool.setuptools.package-data]
pypowsybl = ["py.typed", "*.pyi"]

[project]
name = "pypowsybl"
dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"prettytable>=2.0.0",
"pandas>=2.2.2; python_version >= '3.9'",
"pandas>=2.0.3; python_version <= '3.8'",
"networkx"
]
authors = [
{name = "Geoffroy Jamgotchian", email = "[email protected]" }
]
description = "A PowSyBl Python API"
readme = { file = "README.md", content-type = "text/markdown"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
#"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows"
]

[project.urls]
"Source" = "https://github.com/powsybl/pypowsybl"
"Documentation" = "https://powsybl.readthedocs.io/projects/pypowsybl/en/stable/"

[project.optional-dependencies]
pandapower = ["pandapower>=2.4.11"]

[tool.setuptools.dynamic]
version = {attr = "pypowsybl.__version__"}
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ prettytable==3.11.0 # last version supporting python 3.8
networkx
matplotlib==3.9.2; python_version >= "3.9"
matplotlib==3.7.5; python_version <= "3.8"
pybind11[global]==2.13.6

# optional dependencies
pandapower==2.14.11
Expand All @@ -15,8 +14,7 @@ sphinx==7.1.2
furo==2024.1.29

# CI dependencies
setuptools==75.3.0
wheel==0.44.0
build
coverage==7.3.2
pytest>=8.3.3
mypy==0.982
Expand Down
42 changes: 0 additions & 42 deletions setup.cfg

This file was deleted.

Loading