Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sysconfig if distutils is not available #2570

Merged
merged 1 commit into from
Oct 6, 2023
Merged
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
18 changes: 13 additions & 5 deletions plugins/asyncio/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from distutils import sysconfig
try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

NAME = 'asyncio'

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []
LIBS = []
GCC_LIST = ['asyncio']
18 changes: 13 additions & 5 deletions plugins/gevent/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from distutils import sysconfig
try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

NAME = 'gevent'

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []
LIBS = []

Expand Down
18 changes: 13 additions & 5 deletions plugins/greenlet/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from distutils import sysconfig
try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

NAME = 'greenlet'

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []
LIBS = []

Expand Down
20 changes: 13 additions & 7 deletions plugins/python/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import os
import sys

from distutils import sysconfig

try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

def get_python_version():
version = sysconfig.get_config_var('VERSION')
Expand Down Expand Up @@ -30,10 +39,7 @@ def get_python_version():
'raw'
]

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True),
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []

if 'UWSGI_PYTHON_NOLIB' not in os.environ:
Expand Down
21 changes: 15 additions & 6 deletions plugins/pyuwsgi/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
from distutils import sysconfig
import os, sys
import os
import sys
try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

os.environ['UWSGI_PYTHON_NOLIB'] = '1'

NAME = 'pyuwsgi'

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True),
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []
LIBS = []

Expand Down
18 changes: 13 additions & 5 deletions plugins/stackless/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from distutils import sysconfig
try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

NAME = 'stackless'

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True),
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []
LIBS = []

Expand Down
18 changes: 13 additions & 5 deletions plugins/tornado/uwsgiplugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from distutils import sysconfig
try:
from distutils import sysconfig
paths = [
sysconfig.get_python_inc(),
sysconfig.get_python_inc(plat_specific=True),
]
except ImportError:
import sysconfig
paths = [
sysconfig.get_path('include'),
sysconfig.get_path('platinclude'),
]

NAME = 'tornado'

CFLAGS = [
'-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True),
]
CFLAGS = ['-I' + path for path in paths]
LDFLAGS = []
LIBS = []

Expand Down
3 changes: 1 addition & 2 deletions setup.cpyext.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
import shlex
import uwsgiconfig

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


class uWSGIBuildExt(build_ext):
Expand Down
3 changes: 1 addition & 2 deletions uwsgiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import sys
import subprocess
import sysconfig
from threading import Thread, Lock
from optparse import OptionParser

Expand All @@ -20,8 +21,6 @@
except ImportError:
from Queue import Queue

from distutils import sysconfig

try:
import ConfigParser
except ImportError:
Expand Down
Loading