Skip to content

Commit

Permalink
Remove scikit-build
Browse files Browse the repository at this point in the history
  • Loading branch information
learnforpractice committed Jun 26, 2023
1 parent e795c39 commit 9cba59c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U flake8 pytest scikit-build cython auditwheel
python -m pip install -U flake8 pytest cython auditwheel
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
# generated file by cython
src/_mixin.cpp
.testnet
*.wallet
testnet
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Expand Up @@ -4,7 +4,6 @@ websocket-client>=0.54.0
websockets
dataclasses-json

scikit-build
cython
pytest
pytest-asyncio
Expand Down
37 changes: 34 additions & 3 deletions setup.py
@@ -1,9 +1,13 @@
import os
import sys
import platform
from setuptools import find_packages
from skbuild import setup


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

os.environ["CC"] = "clang"
os.environ["CXX"] = "clang++"

# Require pytest-runner only when running tests
pytest_runner = (['pytest-runner>=2.0,<3dev']
if any(arg in sys.argv for arg in ('pytest', 'test'))
Expand All @@ -22,6 +26,29 @@
version = platform.python_version_tuple()
version = '%s.%s' % (version[0], version[1])

dir_name = os.path.dirname(os.path.realpath(__file__))

if platform.system() == 'Windows':
os.system('cd ./src/mixin &&go build -o mixin.dll -buildmode=c-shared && copy mixin.dll ../../pysrc/mixin.dll && gendef mixin.dll && lib /def:mixin.def /machine:x64 /out:mixin.lib')
else:
os.system('cd ./src/mixin;go build -o libmixin.a -buildmode=c-archive')

ext_modules = [
Extension(
'pymixin._mixin',
sources=[
'src/_mixin.pyx',
],
include_dirs=[
'src/mixin',
],
language='c++',
extra_compile_args=['-std=c++17'],
extra_link_args=['-L./src/mixin', '-lmixin'],
build_dir='build'
)
]

setup(
name="mixin-python",
version="0.2.10",
Expand All @@ -34,6 +61,10 @@
package_data={'pymixin': data},
data_files = data_files,
scripts=[],
ext_modules=cythonize(
ext_modules,
compiler_directives={'language_level': 3, },
),
install_requires=[
"PyJWT>=2.4.0",
"websockets>=9.1",
Expand Down

0 comments on commit 9cba59c

Please sign in to comment.