This repository has been archived by the owner on Nov 23, 2019. It is now read-only.
forked from asottile-archive/future-fstrings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
71 lines (61 loc) · 2.21 KB
/
setup.py
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
import distutils
import os.path
from setuptools import setup
from setuptools.command.install import install as _install
PTH = (
'try:\n'
' import future_fstrings\n'
'except ImportError:\n'
' pass\n'
'else:\n'
' future_fstrings.register()\n'
)
class install(_install):
def initialize_options(self):
_install.initialize_options(self)
# Use this prefix to get loaded as early as possible
name = 'aaaaa_' + self.distribution.metadata.name
contents = 'import sys; exec({!r})\n'.format(PTH)
self.extra_path = (name, contents)
def finalize_options(self):
_install.finalize_options(self)
install_suffix = os.path.relpath(
self.install_lib, self.install_libbase,
)
if install_suffix == '.':
distutils.log.info('skipping install of .pth during easy-install')
elif install_suffix == self.extra_path[1]:
self.install_lib = self.install_libbase
distutils.log.info(
"will install .pth to '%s.pth'",
os.path.join(self.install_lib, self.extra_path[0]),
)
else:
raise AssertionError(
'unexpected install_suffix',
self.install_lib, self.install_libbase, install_suffix,
)
setup(
name='future_fstrings',
description='A backport of fstrings to python<3.6',
url='https://github.com/asottile/future-fstrings',
version='0.4.4',
author='Anthony Sottile',
author_email='asottile@umich.edu',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
extras_require={':python_version<"3.6"': ['tokenize-rt']},
py_modules=['future_fstrings'],
entry_points={'console_scripts': [
'future-fstrings-show=future_fstrings:main',
]},
cmdclass={'install': install},
)