forked from thoth-station/termial-random
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate setup.py to pyproject.toml (thoth-station#8)
- Loading branch information
1 parent
8c93a47
commit 57ec808
Showing
5 changed files
with
61 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from setuptools import Extension | ||
from setuptools.command.build_py import build_py as _build_py | ||
|
||
class build_py(_build_py): | ||
def run(self): | ||
self.run_command("build_ext") | ||
return super().run() | ||
|
||
def initialize_options(self): | ||
super().initialize_options() | ||
if self.distribution.ext_modules == None: | ||
self.distribution.ext_modules = [] | ||
|
||
self.distribution.ext_modules.append( | ||
Extension( | ||
"termial_random.random", | ||
sources=["termial_random/random.c"], | ||
extra_compile_args=["-std=c17", "-lm"], | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "termial-random" | ||
description = "Extensions to standard Python's heapq for performance applications" | ||
authors = [ | ||
{ name="Fridolin Pokorny", email="[email protected]" }, | ||
] | ||
license = {text = "GPLv3+"} | ||
readme = "README.rst" | ||
dynamic = ["version"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "termial_random.__version__"} | ||
|
||
[tool.setuptools] | ||
py-modules = ["_custom_build"] | ||
packages = ["termial_random"] | ||
|
||
[tool.setuptools.cmdclass] | ||
build_py = "_custom_build.build_py" | ||
|
||
[tool.setuptools.exclude-package-data] | ||
termial_random = ["*.c"] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
addopts = "-l -s -vvv" | ||
testpaths = [ | ||
"tests", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[pytest] | ||
minversion = 6.0 | ||
addopts = -l -s -vvv | ||
testpaths = | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[metadata] | ||
url = "https://github.com/thoth-station/termial-random" | ||
download_url = "https://pypi.org/project/termial-random" |