Skip to content

Commit

Permalink
Removed deprecated setup.py imports and arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ml31415 committed Jul 22, 2022
1 parent 04503c3 commit 71f119f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- "main"
- "master"
pull_request:
branches:
- "*"
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set up conda environment
shell: bash -l {0}
run: |
python -m pip install -e .
python -m pip install -e .[tests]
conda list
- name: Run Tests
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
description-file = README.md
description_file = README.md

[aliases]
test=pytest
Expand Down
48 changes: 27 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

import os
import versioneer
from setuptools import setup
from distutils import log
from distutils.command.clean import clean
from distutils.dir_util import remove_tree
from setuptools import setup, Command
from shutil import rmtree

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


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


class NumpyGroupiesClean(clean):
"""Custom clean command to tidy up the project root."""
class Clean(Command):
description = "clean up temporary files from 'build' command"
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
clean.run(self)
for folder in ('build', 'numpy_groupies.egg-info'):
for folder in ('build', 'dist', 'intnan.egg-info'):

This comment has been minimized.

Copy link
@sebastic

sebastic Jan 7, 2023

The .egg-info directory is wrong.

path = os.path.join(base_path, folder)
if os.path.isdir(path):
remove_tree(path, dry_run=self.dry_run)
if not self.dry_run:
self._rm_walk()
print("removing '{}' (and everything under it)".format(path))
if not self.dry_run:
rmtree(path)
self._rm_walk()

def _rm_walk(self):
for path, dirs, files in os.walk(base_path):
if any(p.startswith('.') for p in path.split(os.path.sep)):
# Skip hidden directories like the git folder right away
continue
if path.endswith('__pycache__'):
remove_tree(path, dry_run=self.dry_run)
print("removing '{}' (and everything under it)".format(path))
if not self.dry_run:
rmtree(path)
else:
for fname in files:
if fname.endswith('.pyc') or fname.endswith('.so'):
fpath = os.path.join(path, fname)
os.remove(fpath)
log.info("removing '%s'", fpath)
print("removing '{}'".format(fpath))
if not self.dry_run:
os.remove(fpath)


setup(name='numpy_groupies',
Expand All @@ -62,15 +70,13 @@ def _rm_walk(self):
download_url="https://github.com/ml31415/numpy-groupies/archive/master.zip",
keywords=[ "accumarray", "aggregate", "groupby", "grouping", "indexing"],
packages=['numpy_groupies'],
install_requires=[],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'numpy', 'numba'],
install_requires=['numpy', 'numba'],
extras_require={'tests': ['pytest']},
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
cmdclass=dict(clean=NumpyGroupiesClean, **versioneer.get_cmdclass()),
'Programming Language :: Python :: 3.10'],
cmdclass=dict(clean=Clean, **versioneer.get_cmdclass()),
)

0 comments on commit 71f119f

Please sign in to comment.