Skip to content

Commit

Permalink
Package build now works simply with 'pipx run build'
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Nov 11, 2024
1 parent 5045c36 commit f5511f0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
.savegame/
__pycache__/
build/
dist/
cydoomgeneric/cydoomgeneric.c
uv.lock

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include ./cydoomgeneric/cydoomgeneric.pxd
include ./doomgeneric/*.h
2 changes: 2 additions & 0 deletions cydoomgeneric/cydoomgeneric.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#cython: language_level=3

"""
Copyright(C) 2023-2024 Wojciech Graj
Expand Down
2 changes: 2 additions & 0 deletions cydoomgeneric/cydoomgeneric.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#cython: language_level=3

"""
Copyright(C) 2023-2024 Wojciech Graj
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "cython", "numpy>=1.25"]
requires = ["setuptools>=18.0", "cython", "numpy>=1.25"]
build-backend = "setuptools.build_meta"

[project]
Expand Down
33 changes: 19 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import sys

import numpy
from Cython.Build import cythonize
from setuptools import Extension, setup

doom_src = (
Expand Down Expand Up @@ -114,16 +113,22 @@
define_macros.extend([("NORMALUNIX", None), ("LINUX", None),
("_DEFAULT_SOURCE", None)])

setup(ext_modules=cythonize([
Extension("cydoomgeneric",
sources=["./cydoomgeneric/cydoomgeneric.pyx"] +
[f"./doomgeneric/{src}" for src in doom_src],
include_dirs=["./doomgeneric",
numpy.get_include()],
define_macros=define_macros,
extra_link_args=extra_link_args,
libraries=libraries),
],
language_level=3),
package_data={"cydoomgeneric": ["py.typed", "__init__.pyi"]},
packages=["cydoomgeneric"])
ext = Extension(
"cydoomgeneric",
sources=(
[
"./cydoomgeneric/cydoomgeneric.pyx",
] +
[f"./doomgeneric/{src}" for src in doom_src]
),
include_dirs=["./doomgeneric", numpy.get_include()],
define_macros=define_macros,
extra_link_args=extra_link_args,
libraries=libraries
)

setup(
ext_modules=[ext],
package_data={"cydoomgeneric": ["py.typed", "__init__.pyi"]},
packages=["cydoomgeneric"]
)

0 comments on commit f5511f0

Please sign in to comment.