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

Replace imports of distutils. #385

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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 bmtk/analyzer/spikes_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import numpy as np

try:
from distutils.version import LooseVersion
use_sort_values = LooseVersion(pd.__version__) >= LooseVersion('0.19.0')
from packaging.version import Version
use_sort_values = Version(pd.__version__) >= Version('0.19.0')

except:
use_sort_values = False
Expand Down
4 changes: 2 additions & 2 deletions bmtk/utils/compile_mechanisms/compile_mechanisms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import logging
from subprocess import call
from distutils.dir_util import copy_tree
from shutil import copytree


logger = logging.getLogger(__name__)
Expand All @@ -28,4 +28,4 @@ def copy_modfiles(mechanisms_dir, cached_dir=None):
cached_dir = os.path.join(local_path, '..', 'scripts/bionet/mechanisms')

logger.info('Copying mod files from {} to {}'.format(cached_dir, mechanisms_dir))
copy_tree(cached_dir, mechanisms_dir)
copytree(cached_dir, mechanisms_dir, dirs_exist_ok=True)
4 changes: 2 additions & 2 deletions bmtk/utils/create_environment/env_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from subprocess import call
from collections import OrderedDict
import logging
from distutils.dir_util import copy_tree
from shutil import copytree

from bmtk.utils.compile_mechanisms import copy_modfiles, compile_mechanisms

Expand Down Expand Up @@ -270,7 +270,7 @@ def _create_components_dir(self, components_dir, with_examples=True):

if with_examples:
logger.info(' Copying files from {}.'.format(src_dir))
copy_tree(src_dir, trg_dir)
copytree(src_dir, trg_dir, dirs_exist_ok=True)

# return components_config
self._circuit_config['components'] = components_config
Expand Down
6 changes: 3 additions & 3 deletions bmtk/utils/sim_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from optparse import OptionParser
from collections import OrderedDict
import logging
from distutils.dir_util import copy_tree
from shutil import copytree


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -248,7 +248,7 @@ def _create_components_dir(self, components_dir, with_examples=True):

if with_examples:
logger.info(' Copying files from {}.'.format(src_dir))
copy_tree(src_dir, trg_dir)
copytree(src_dir, trg_dir, dirs_exist_ok=True)

# return components_config
self._circuit_config['components'] = components_config
Expand Down Expand Up @@ -852,4 +852,4 @@ def membrane_report_parser(option, opt, value, parser):
elif target_sim == 'filternet':
build_env_filternet(base_dir=base_dir, network_dir=options.network_dir, tstop=options.tstop,
include_examples=options.include_examples,
config_file=options.config_file)
config_file=options.config_file)
Loading