Skip to content

Commit

Permalink
style: format sources
Browse files Browse the repository at this point in the history
  • Loading branch information
hrz6976 committed Jun 11, 2024
1 parent 728546c commit 379e3e2
Show file tree
Hide file tree
Showing 20 changed files with 855 additions and 595 deletions.
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ default_language_version:
python: python3.8

repos:
# general checks (see here: https://pre-commit.com/hooks.html)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace

# ruff: linting + formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
Expand Down
48 changes: 25 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import os
from setuptools import setup, Extension, find_packages

from Cython.Build import cythonize

# Thanks to @tryptofame for proposing an updated snippet
from Cython.Compiler.Options import get_directive_defaults
from setuptools import Extension, find_packages, setup

directive_defaults = get_directive_defaults()

directive_defaults['linetrace'] = True
directive_defaults['binding'] = True
directive_defaults["linetrace"] = True
directive_defaults["binding"] = True

ROOT = os.path.abspath(os.path.dirname(__file__))
PACKAGE_ROOT = os.path.join(ROOT, "woc")
Expand All @@ -16,28 +18,28 @@

ext_modules = [
Extension(
'woc.local',
libraries=['bz2', 'z'],
include_dirs=['lib'],
"woc.local",
libraries=["bz2", "z"],
include_dirs=["lib"],
sources=[
os.path.join(PACKAGE_ROOT, 'local.pyx'),
],
extra_compile_args=['-std=gnu11'],
define_macros=[('CYTHON_TRACE', '1')],
os.path.join(PACKAGE_ROOT, "local.pyx"),
],
extra_compile_args=["-std=gnu11"],
define_macros=[("CYTHON_TRACE", "1")],
),
Extension(
'woc.tch',
libraries=['bz2', 'z'],
include_dirs=['lib'],
"woc.tch",
libraries=["bz2", "z"],
include_dirs=["lib"],
sources=[
os.path.join(PACKAGE_ROOT, 'tch.pyx'),
os.path.join(TCH_ROOT, 'tchdb.c'),
os.path.join(TCH_ROOT, 'myconf.c'),
os.path.join(TCH_ROOT, 'tcutil.c'),
os.path.join(TCH_ROOT, 'md5.c')
],
extra_compile_args=['-std=gnu11'],
define_macros=[('CYTHON_TRACE', '1')],
os.path.join(PACKAGE_ROOT, "tch.pyx"),
os.path.join(TCH_ROOT, "tchdb.c"),
os.path.join(TCH_ROOT, "myconf.c"),
os.path.join(TCH_ROOT, "tcutil.c"),
os.path.join(TCH_ROOT, "md5.c"),
],
extra_compile_args=["-std=gnu11"],
define_macros=[("CYTHON_TRACE", "1")],
),
]

Expand All @@ -47,5 +49,5 @@
packages=PACKAGES,
package_data={"": ["*.pyx", "*.pxd", "*.pxi"]},
include_package_data=True,
script_args=['build_ext', '--inplace'],
)
script_args=["build_ext", "--inplace"],
)
Loading

0 comments on commit 379e3e2

Please sign in to comment.