Skip to content

Commit 71f119f

Browse files
committed
Removed deprecated setup.py imports and arguments
1 parent 04503c3 commit 71f119f

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
- "main"
5+
- "master"
66
pull_request:
77
branches:
88
- "*"
@@ -61,7 +61,7 @@ jobs:
6161
- name: Set up conda environment
6262
shell: bash -l {0}
6363
run: |
64-
python -m pip install -e .
64+
python -m pip install -e .[tests]
6565
conda list
6666
6767
- name: Run Tests

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
description-file = README.md
2+
description_file = README.md
33

44
[aliases]
55
test=pytest

setup.py

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
import os
44
import versioneer
5-
from setuptools import setup
6-
from distutils import log
7-
from distutils.command.clean import clean
8-
from distutils.dir_util import remove_tree
5+
from setuptools import setup, Command
6+
from shutil import rmtree
97

108
base_path = os.path.dirname(os.path.abspath(__file__))
119

12-
1310
long_description = """
1411
This package consists of a couple of optimised tools for doing things that can roughly be
1512
considered "group-indexing operations". The most prominent tool is `aggregate`.
@@ -25,30 +22,41 @@
2522
"""
2623

2724

28-
class NumpyGroupiesClean(clean):
29-
"""Custom clean command to tidy up the project root."""
25+
class Clean(Command):
26+
description = "clean up temporary files from 'build' command"
27+
user_options = []
28+
29+
def initialize_options(self):
30+
pass
31+
32+
def finalize_options(self):
33+
pass
34+
3035
def run(self):
31-
clean.run(self)
32-
for folder in ('build', 'numpy_groupies.egg-info'):
36+
for folder in ('build', 'dist', 'intnan.egg-info'):
3337
path = os.path.join(base_path, folder)
3438
if os.path.isdir(path):
35-
remove_tree(path, dry_run=self.dry_run)
36-
if not self.dry_run:
37-
self._rm_walk()
39+
print("removing '{}' (and everything under it)".format(path))
40+
if not self.dry_run:
41+
rmtree(path)
42+
self._rm_walk()
3843

3944
def _rm_walk(self):
4045
for path, dirs, files in os.walk(base_path):
4146
if any(p.startswith('.') for p in path.split(os.path.sep)):
4247
# Skip hidden directories like the git folder right away
4348
continue
4449
if path.endswith('__pycache__'):
45-
remove_tree(path, dry_run=self.dry_run)
50+
print("removing '{}' (and everything under it)".format(path))
51+
if not self.dry_run:
52+
rmtree(path)
4653
else:
4754
for fname in files:
4855
if fname.endswith('.pyc') or fname.endswith('.so'):
4956
fpath = os.path.join(path, fname)
50-
os.remove(fpath)
51-
log.info("removing '%s'", fpath)
57+
print("removing '{}'".format(fpath))
58+
if not self.dry_run:
59+
os.remove(fpath)
5260

5361

5462
setup(name='numpy_groupies',
@@ -62,15 +70,13 @@ def _rm_walk(self):
6270
download_url="https://github.com/ml31415/numpy-groupies/archive/master.zip",
6371
keywords=[ "accumarray", "aggregate", "groupby", "grouping", "indexing"],
6472
packages=['numpy_groupies'],
65-
install_requires=[],
66-
setup_requires=['pytest-runner'],
67-
tests_require=['pytest', 'numpy', 'numba'],
73+
install_requires=['numpy', 'numba'],
74+
extras_require={'tests': ['pytest']},
6875
classifiers=['Development Status :: 4 - Beta',
6976
'Intended Audience :: Science/Research',
7077
'Programming Language :: Python :: 3.7',
7178
'Programming Language :: Python :: 3.8',
7279
'Programming Language :: Python :: 3.9',
73-
'Programming Language :: Python :: 3.10',
74-
],
75-
cmdclass=dict(clean=NumpyGroupiesClean, **versioneer.get_cmdclass()),
80+
'Programming Language :: Python :: 3.10'],
81+
cmdclass=dict(clean=Clean, **versioneer.get_cmdclass()),
7682
)

0 commit comments

Comments
 (0)