-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py.old
More file actions
65 lines (51 loc) · 1.65 KB
/
Copy pathsetup.py.old
File metadata and controls
65 lines (51 loc) · 1.65 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
#!/usr/bin/env python
# This file is managed by 'repo_helper'. Don't edit it directly.
# stdlib
import distutils.log
import os
import shutil
import sys
# 3rd party
import setuptools.command.install
from setuptools import setup
sys.path.append('.')
# this package
from __pkginfo__ import * # pylint: disable=wildcard-import
PTH = 'import sys\n\ntry:\n import emoji_strings\n del sys.modules["emoji_strings"]\nexcept ImportError:\n pass\n'
class install(setuptools.command.install.install):
def initialize_options(self):
super().initialize_options()
# Use this prefix to get loaded as early as possible
name = "aaaaa_" + self.distribution.metadata.name
contents = f'import sys; exec({PTH!r})\n'
self.extra_path = (name, contents)
def finalize_options(self):
super().finalize_options()
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(
cmdclass={"install": install},
description="Adds support for emoji-strings in Python, which convert emoji names into actual emoji.",
extras_require=extras_require,
install_requires=install_requires,
py_modules=[],
version=__version__,
)
shutil.rmtree("emoji_strings.egg-info", ignore_errors=True)