try to fix pypy build

pull/39/head
Ciro 2022-05-28 19:49:16 -03:00
rodzic 01920b1f08
commit 5e2e0e0d3d
5 zmienionych plików z 25 dodań i 16 usunięć

6
.gitignore vendored
Wyświetl plik

@ -1,7 +1,7 @@
__pycache__ __pycache__
/src/socketify/uWebSockets
/src/socketify.egg-info /src/socketify.egg-info
/build/ /build
/dist/ /dist
/uWebSockets/
/src/socketify/*.so /src/socketify/*.so
*.so *.so

2
.gitmodules vendored
Wyświetl plik

@ -1,4 +1,4 @@
[submodule "uWebSockets"] [submodule "uWebSockets"]
path = uWebSockets path = src/socketify/uWebSockets
url = https://github.com/cirospaciari/uWebSockets url = https://github.com/cirospaciari/uWebSockets
branch = capi-complete-with-ssl-and-samples branch = capi-complete-with-ssl-and-samples

Wyświetl plik

@ -16,9 +16,9 @@ app.run()
### pip install ### pip install
```bash ```bash
pip install git+https://github.com/cirospaciari/socketify.py.git pip install git+https://github.com/cirospaciari/socketify.py.git --global-option=build_ext
#or specify PyPy3 #or specify PyPy3
pypy3 -m pip install git+https://github.com/cirospaciari/socketify.py.git pypy3 -m pip install git+https://github.com/cirospaciari/socketify.py.git --global-option=build_ext
``` ```
### Run ### Run
@ -46,7 +46,7 @@ git submodule update --init --recursive --remote
pypy3 -m pip install --upgrade build pypy3 -m pip install --upgrade build
#build and install #build and install
pypy3 -m build pypy3 -m build
pypy3 -m pip install . pypy3 -m pip install . --no-cache-dir --global-option=build_ext
#if you want to remove #if you want to remove
pypy3 -m pip uninstall socketify pypy3 -m pip uninstall socketify
``` ```

Wyświetl plik

@ -9,21 +9,30 @@ if sys.platform in ('win32', 'cygwin', 'cli'):
import setuptools import setuptools
from setuptools.command.sdist import sdist from setuptools.command.sdist import sdist
from setuptools.command.build_ext import build_ext
import pathlib import pathlib
import os import os
import shutil import shutil
import subprocess import subprocess
_ROOT = pathlib.Path(__file__).parent _ROOT = pathlib.Path(__file__).parent
UWS_DIR = str(_ROOT / "uWebSockets")
UWS_CAPI_DIR = str(_ROOT / "build" / "uWebSockets" / "capi")
UWS_CAPI_DIR = str(_ROOT / "build" / "uWebSockets" / "capi") UWS_CAPI_DIR = str(_ROOT / "build" / "uWebSockets" / "capi")
UWS_LIB_PATH = str(_ROOT / "build" / "uWebSockets" / "capi" / "libuwebsockets.so") UWS_LIB_PATH = str(_ROOT / "build" / "uWebSockets" / "capi" / "libuwebsockets.so")
UWS_BUILD_DIR = str(_ROOT / "build"/ "uWebSockets") UWS_DIR = str(_ROOT / "src" / "socketify" /"uWebSockets")
UWS_BUILD_DIR = str(_ROOT / "build" /"uWebSockets")
UWS_LIB_OUTPUT = str(_ROOT / "src" / "socketify" / "libuwebsockets.so") UWS_LIB_OUTPUT = str(_ROOT / "src" / "socketify" / "libuwebsockets.so")
class Makefile(sdist): class Prepare(sdist):
def run(self):
super().run()
class Makefile(build_ext):
def run(self): def run(self):
env = os.environ.copy() env = os.environ.copy()
if os.path.exists(UWS_BUILD_DIR): if os.path.exists(UWS_BUILD_DIR):
shutil.rmtree(UWS_BUILD_DIR) shutil.rmtree(UWS_BUILD_DIR)
shutil.copytree(UWS_DIR, UWS_BUILD_DIR) shutil.copytree(UWS_DIR, UWS_BUILD_DIR)
@ -55,11 +64,12 @@ setuptools.setup(
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
], ],
packages=["socketify"],
package_dir={"": "src"}, package_dir={"": "src"},
package_data={"": ['./libuwebsockets.so']}, package_data={"": ['./*.so', './uWebSockets/*','./uWebSockets/*/*','./uWebSockets/*/*/*']},
packages=setuptools.find_packages(where="src"),
python_requires=">=3.7", python_requires=">=3.7",
cmdclass={'sdist': Makefile}, install_requires=["cffi>=1.0.0"],
include_package_data=True, has_ext_modules=lambda: True,
install_requires=[] cmdclass={'sdist': Prepare,'build_ext': Makefile},
include_package_data=True
) )

@ -1 +0,0 @@
Subproject commit fd78f2960ac3c8ac529a11f115ba824db7e60c09