kopia lustrzana https://github.com/cirospaciari/socketify.py
try to fix pypy build
rodzic
01920b1f08
commit
5e2e0e0d3d
|
@ -1,7 +1,7 @@
|
|||
__pycache__
|
||||
/src/socketify/uWebSockets
|
||||
/src/socketify.egg-info
|
||||
/build/
|
||||
/dist/
|
||||
/uWebSockets/
|
||||
/build
|
||||
/dist
|
||||
/src/socketify/*.so
|
||||
*.so
|
|
@ -1,4 +1,4 @@
|
|||
[submodule "uWebSockets"]
|
||||
path = uWebSockets
|
||||
path = src/socketify/uWebSockets
|
||||
url = https://github.com/cirospaciari/uWebSockets
|
||||
branch = capi-complete-with-ssl-and-samples
|
|
@ -16,9 +16,9 @@ app.run()
|
|||
### pip install
|
||||
|
||||
```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
|
||||
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
|
||||
|
@ -46,7 +46,7 @@ git submodule update --init --recursive --remote
|
|||
pypy3 -m pip install --upgrade build
|
||||
#build and install
|
||||
pypy3 -m build
|
||||
pypy3 -m pip install .
|
||||
pypy3 -m pip install . --no-cache-dir --global-option=build_ext
|
||||
#if you want to remove
|
||||
pypy3 -m pip uninstall socketify
|
||||
```
|
26
setup.py
26
setup.py
|
@ -9,21 +9,30 @@ if sys.platform in ('win32', 'cygwin', 'cli'):
|
|||
|
||||
import setuptools
|
||||
from setuptools.command.sdist import sdist
|
||||
from setuptools.command.build_ext import build_ext
|
||||
|
||||
import pathlib
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
_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_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")
|
||||
|
||||
class Makefile(sdist):
|
||||
class Prepare(sdist):
|
||||
def run(self):
|
||||
super().run()
|
||||
|
||||
class Makefile(build_ext):
|
||||
def run(self):
|
||||
env = os.environ.copy()
|
||||
|
||||
if os.path.exists(UWS_BUILD_DIR):
|
||||
shutil.rmtree(UWS_BUILD_DIR)
|
||||
shutil.copytree(UWS_DIR, UWS_BUILD_DIR)
|
||||
|
@ -55,11 +64,12 @@ setuptools.setup(
|
|||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
],
|
||||
packages=["socketify"],
|
||||
package_dir={"": "src"},
|
||||
package_data={"": ['./libuwebsockets.so']},
|
||||
packages=setuptools.find_packages(where="src"),
|
||||
package_data={"": ['./*.so', './uWebSockets/*','./uWebSockets/*/*','./uWebSockets/*/*/*']},
|
||||
python_requires=">=3.7",
|
||||
cmdclass={'sdist': Makefile},
|
||||
include_package_data=True,
|
||||
install_requires=[]
|
||||
install_requires=["cffi>=1.0.0"],
|
||||
has_ext_modules=lambda: True,
|
||||
cmdclass={'sdist': Prepare,'build_ext': Makefile},
|
||||
include_package_data=True
|
||||
)
|
|
@ -1 +0,0 @@
|
|||
Subproject commit fd78f2960ac3c8ac529a11f115ba824db7e60c09
|
Ładowanie…
Reference in New Issue