Last active
June 3, 2016 14:27
-
-
Save dholth/59e4c8a0c0d963b019d81e18bf0a89e3 to your computer and use it in GitHub Desktop.
Write setuptools' setup_requires and tests_require to a file in egg_info. As is always the case with setuptools, it still installs setup_requires as a side effect.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def requires_writer(cmd, basename, filename): | |
cmd.write_file("setup_requires", filename, | |
str(cmd.distribution.setup_requires) + '\n' + | |
str(cmd.distribution.tests_require) + '\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import setup | |
setup(name='acmd', | |
version='1.0', | |
description="Write setup_requires.txt to egg_info", | |
py_modules = ['acmd'], | |
setup_requires = ['pip', 'wheel', 'setuptools'], | |
tests_require = ['simplejson'], | |
zip_safe=False, | |
entry_points={ | |
"egg_info.writers": [ | |
"setup_requires.txt = acmd:requires_writer" | |
] | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment