-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
74 lines (62 loc) · 2.13 KB
/
Copy pathsetup.py
File metadata and controls
74 lines (62 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import os
from shutil import rmtree
from setuptools import Command, find_packages, setup
with open('README.md', 'r') as f:
long_description = f.read()
class Clean(Command):
"""Clean up build results
With PEP 632, distutils is deprecated and setuptools does not appear to
include a clean command. Additionall, the old distutils clean command
failed to remove things like the dist and *.egg-info directories.
"""
descripion = 'clean up all build results'
user_options = [
('dry-run', 'd', 'dry run')
]
def initialize_options(self) -> None:
self.egg_info = None
self.dist_dir = None
self.eggs = None
self.dry_run = None
def finalize_options(self) -> None:
dist_name = self.distribution.get_name()
self.egg_info = f'{dist_name}.egg-info'
self.dist_dir = self.get_finalized_command('sdist').dist_dir
self.eggs = '.eggs'
def run(self) -> None:
dirs = [self.egg_info, self.dist_dir, self.eggs]
for directory in dirs:
if os.path.exists(directory):
self.remove_tree(directory)
def remove_tree(self, directory: str) -> None:
if self.dry_run:
print(f'Remove directory {directory}')
else:
rmtree(directory)
setup(
name='setuptools_node',
version='0.3.1.dev1',
description='Setuptools extensions for working with node',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/dj51d/setuptools-node',
author='Dan Johnson',
author_email='dj51d@warbirdsurvivors.com',
packages=find_packages(),
install_requires=[
'setuptools>=65.5.1'
],
python_requires='>=3.6',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
cmdclass={
'clean': Clean
}
)