Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace distutils #86

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

Merged
merged 3 commits into from
Mar 16, 2022
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
4 changes: 2 additions & 2 deletions labscript_utils/ls_zprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import sys
import os
from socket import gethostbyname
from distutils.version import LooseVersion
from packaging.version import Version
import zmq

import zprocess
Expand Down Expand Up @@ -337,7 +337,7 @@ def connect_to_zlock_server():
global _zlock_server_supports_readwrite
if hasattr(client, 'get_protocol_version'):
version = client.get_protocol_version()
if LooseVersion(version) >= LooseVersion('1.1.0'):
if Version(version) >= Version('1.1.0'):
_zlock_server_supports_readwrite = True

# The user can call these functions to change the timeouts later if they
Expand Down
10 changes: 5 additions & 5 deletions labscript_utils/modulewatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
import os
import imp
import site
import distutils.sysconfig
import sysconfig


# Directories in which the standard library and installed packages may be located.
# Modules in these locations will be whitelisted:
PKGDIRS = [
distutils.sysconfig.get_python_lib(plat_specific=True, standard_lib=True),
distutils.sysconfig.get_python_lib(plat_specific=True, standard_lib=False),
distutils.sysconfig.get_python_lib(plat_specific=False, standard_lib=True),
distutils.sysconfig.get_python_lib(plat_specific=False, standard_lib=False),
sysconfig.get_path('platstdlib'),
sysconfig.get_path('platlib'),
sysconfig.get_path('stdlib'),
sysconfig.get_path('purelib'),
site.getusersitepackages(),
]
PKGDIRS += site.getsitepackages()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from setuptools import setup
from setuptools.command.develop import develop
from distutils import log
import logging


class develop_command(develop):
Expand All @@ -11,7 +11,7 @@ def run(self):
path = os.path.join(self.install_dir, 'labscript-suite.pth')
super().run()
if not self.uninstall:
log.info(f'Copying labscript-suite.pth to {path}')
logging.info(f'Copying labscript-suite.pth to {path}')
if not self.dry_run:
self.copy_file('labscript-suite.pth', path)

Expand Down