Skip to content

Commit d64afe8

Browse files
committed
Go back to setuptools instead of hatchling
1 parent 1ec12ca commit d64afe8

3 files changed

Lines changed: 41 additions & 29 deletions

File tree

.github/workflows/publish-to-pypi.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,11 @@ jobs:
4848
architecture: ${{ matrix.config.pyarch }}
4949
- name: Install uv
5050
uses: astral-sh/setup-uv@v4
51-
- name: Build Package
51+
- name: Build Package (Linux)
52+
if: matrix.config.os != 'windows-latest'
5253
run: uv build
53-
- name: (Windows x64) Retarget wheel
54-
if: matrix.config.name == 'windows-x64'
55-
run: |
56-
rm dist/*.tar.gz
57-
uv run python -m ensurepip
58-
uv run python -m pip install wheel
59-
for f in dist/pylsl*.whl; do uv run wheel tags --platform-tag win_amd64 "$f" && rm "$f"; done
60-
- name: (Windows 32) Retarget wheel
61-
if: matrix.config.name == 'windows-x86'
62-
run: |
63-
rm dist/*.tar.gz
64-
uv run python -m ensurepip
65-
uv run python -m pip install wheel
66-
for f in dist/pylsl*.whl; do uv run wheel tags --platform-tag win32 "$f" && rm "$f"; done
54+
- name: Build Package (Windows)
55+
if: matrix.config.os == 'windows-latest'
56+
run: uv build --wheel
6757
- name: Publish package distributions to PyPI
6858
run: uv publish

pyproject.toml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,11 @@ dev = [
5555
]
5656

5757
[build-system]
58-
requires = ["hatchling", "hatch-vcs"]
59-
build-backend = "hatchling.build"
58+
requires = ["setuptools>=64", "setuptools-scm>=8"]
59+
build-backend = "setuptools.build_meta"
6060

61-
[tool.hatch.version]
62-
source = "vcs"
61+
[tool.setuptools_scm]
62+
version_file = "src/pylsl/__version__.py"
6363

64-
[tool.hatch.build.hooks.vcs]
65-
version-file = "src/pylsl/__version__.py"
66-
67-
[tool.hatch.build.targets.wheel]
68-
packages = ["src/pylsl"]
69-
artifacts = ["*.dll"]
70-
71-
#package_data={
72-
# "pylsl": ["lib/*.dll"],
73-
# }
64+
[tool.setuptools.package-data]
65+
pylsl = ["lib/*.dll"]

setup.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import sys
2+
3+
from setuptools import setup
4+
# from setuptools.dist import Distribution
5+
6+
7+
# class BinaryDistribution(Distribution):
8+
# """Distribution which always forces a binary package with platform name"""
9+
# def has_ext_modules(foo):
10+
# return sys.platform.startswith("win")
11+
12+
try:
13+
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
14+
class bdist_wheel(_bdist_wheel):
15+
def finalize_options(self):
16+
super().finalize_options()
17+
self.root_is_pure = not sys.platform.startswith("win")
18+
def get_tag(self):
19+
python, abi, plat = _bdist_wheel.get_tag(self)
20+
# We don't contain any python source
21+
python, abi = 'py2.py3', 'none'
22+
return python, abi, plat
23+
except ImportError:
24+
bdist_wheel = None
25+
26+
27+
setup(
28+
# distclass=BinaryDistribution,
29+
cmdclass={"bdist_wheel": bdist_wheel},
30+
)

0 commit comments

Comments
 (0)