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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.nox
nosetests.xml
.pytest_cache

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![pystable-ubuntu](https://github.com/mikeyrf/pystable/actions/workflows/python-ubuntu.yaml/badge.svg)](https://github.com/mikeyrf/pystable/actions/workflows/python-ubuntu.yaml)
[![pystable-macOS](https://github.com/mikeyrf/pystable/actions/workflows/python-macOS.yaml/badge.svg)](https://github.com/mikeyrf/pystable/actions/workflows/python-macOS.yaml)
[![coverage](https://github.com/mikeyrf/pystable/tree/main/docs/coverage.svg)](https://github.com/mikeyrf/pystable/tree/main/docs/coverage.svg)
[![coverage](./docs/coverage.svg)](./docs/coverage.svg)

# pystable

Expand Down
22 changes: 20 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import shutil

from distutils.command.build_ext import build_ext
from distutils.core import setup, Extension
from distutils.core import Distribution
from distutils.core import Extension


libstable_module = Extension('libstable',
Expand All @@ -23,6 +24,7 @@


# SEE: https://github.com/python-poetry/poetry/issues/11
# SEE: https://github.com/sdispater/pendulum/blob/master/build.py
class ExtensionBuild(build_ext):
def run(self):
build_ext.run(self)
Expand All @@ -46,4 +48,20 @@ def run(self):
os.chmod(dest, mode)


setup(ext_modules=[libstable_module], cmdclass=dict(build_ext=ExtensionBuild))
def build(setup_kwargs):
"""
This function is mandatory in order to build the extensions.
"""
distribution = Distribution(
{"name": "pystable", "ext_modules": [libstable_module]})
distribution.package_dir = "pystable"

cmd = ExtensionBuild(distribution)
cmd.ensure_finalized()
cmd.run()

return setup_kwargs


if __name__ == "__main__":
build({})
8 changes: 5 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
def tests(session):
session.install('poetry')
session.run('poetry', 'install')
session.run('coverage', 'run', '-m', 'pytest')
session.run('coverage', 'report')
session.run('poetry', 'build')
session.run('poetry', 'run', 'coverage', 'run', '-m', 'pytest', '-v', '-s')
session.run('poetry', 'run', 'coverage', 'report')


@nox.session
def lint(session):
session.install('poetry')
session.run('poetry', 'install')
session.run('flake8', 'pystable', 'tests')
session.run('poetry', 'build')
session.run('poetry', 'run', 'flake8', 'pystable', 'tests')
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ coverage = {version = "^5.5", extras = ["toml"]}
nox = "^2021.6.12"
coverage-badge = "^1.0.1"

[tool.poetry.build]
script = "build.py"

[tool.coverage.run]
omit = [".*", "*/site-packages/*", "*/tests*"]

Expand Down
Binary file modified pystable/_extensions/macOS/arm/libstable.so
Binary file not shown.