mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 10:04:07 +00:00
remove use of deprecated distutils
distutils is slated for deprecation in the stdlib we can use packaging for version parsing and setuptools in setup.py packaging is technically an extra dependency, but rarely missing because it's so widespread
This commit is contained in:
@@ -46,10 +46,12 @@ def _check_version(hub_version, singleuser_version, log):
|
|||||||
|
|
||||||
# compare minor X.Y versions
|
# compare minor X.Y versions
|
||||||
if hub_version != singleuser_version:
|
if hub_version != singleuser_version:
|
||||||
from distutils.version import LooseVersion as V
|
from packaging.version import parse
|
||||||
|
|
||||||
hub_major_minor = V(hub_version).version[:2]
|
hub = parse(hub_version)
|
||||||
singleuser_major_minor = V(singleuser_version).version[:2]
|
hub_major_minor = (hub.major, hub.minor)
|
||||||
|
singleuser = parse(singleuser_version)
|
||||||
|
singleuser_major_minor = (singleuser.major, singleuser.minor)
|
||||||
extra = ""
|
extra = ""
|
||||||
do_log = True
|
do_log = True
|
||||||
if singleuser_major_minor == hub_major_minor:
|
if singleuser_major_minor == hub_major_minor:
|
||||||
|
@@ -5,6 +5,7 @@ entrypoints
|
|||||||
jinja2>=2.11.0
|
jinja2>=2.11.0
|
||||||
jupyter_telemetry>=0.1.0
|
jupyter_telemetry>=0.1.0
|
||||||
oauthlib>=3.0
|
oauthlib>=3.0
|
||||||
|
packaging
|
||||||
pamela; sys_platform != 'win32'
|
pamela; sys_platform != 'win32'
|
||||||
prometheus_client>=0.4.0
|
prometheus_client>=0.4.0
|
||||||
psutil>=5.6.5; sys_platform == 'win32'
|
psutil>=5.6.5; sys_platform == 'win32'
|
||||||
|
12
setup.py
12
setup.py
@@ -12,8 +12,11 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
|
|
||||||
|
from setuptools import Command
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
from setuptools.command.bdist_egg import bdist_egg
|
from setuptools.command.bdist_egg import bdist_egg
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
from setuptools.command.sdist import sdist
|
||||||
|
|
||||||
|
|
||||||
v = sys.version_info
|
v = sys.version_info
|
||||||
@@ -131,15 +134,6 @@ setup_args = dict(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# custom distutils commands
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# imports here, so they are after setuptools import if there was one
|
|
||||||
from distutils.cmd import Command
|
|
||||||
from distutils.command.build_py import build_py
|
|
||||||
from distutils.command.sdist import sdist
|
|
||||||
|
|
||||||
|
|
||||||
def mtime(path):
|
def mtime(path):
|
||||||
"""shorthand for mtime"""
|
"""shorthand for mtime"""
|
||||||
|
Reference in New Issue
Block a user