diff options
author | Carlo Zancanaro <carlo@zancanaro.id.au> | 2022-09-25 00:10:13 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@zancanaro.id.au> | 2022-09-25 00:38:04 +1000 |
commit | 7daa5284f9eddf6d4b4e7838919e80ce25324bb0 (patch) | |
tree | ac92d9aa97621b4c314441a4cb7cdcab60b4f85e /setup.py | |
parent | e031af6e5e8324fe4cda66d9597904040b17ca80 (diff) |
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/setup.py b/setup.py deleted file mode 100644 index cd079e6..0000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# Install dependencies from a "[metadata] setup-requires = ..." section in -# setup.cfg, then run real-setup.py. -# From https://bitbucket.org/dholth/setup-requires - -import sys, os, subprocess, codecs, pkg_resources - -sys.path[0:0] = ['setup-requires'] -pkg_resources.working_set.add_entry('setup-requires') - -try: - import configparser -except: - import ConfigParser as configparser - -def get_requirements(): - if not os.path.exists('setup.cfg'): return - config = configparser.ConfigParser() - config.readfp(codecs.open('setup.cfg', encoding='utf-8')) - setup_requires = config.get('metadata', 'setup-requires') - specifiers = [line.strip() for line in setup_requires.splitlines()] - for specifier in specifiers: - try: - pkg_resources.require(specifier) - except pkg_resources.DistributionNotFound: - yield specifier - -try: - to_install = list(get_requirements()) - if to_install: - subprocess.call([sys.executable, "-m", "pip", "install", - "-t", "setup-requires"] + to_install) -except (configparser.NoSectionError, configparser.NoOptionError): - pass - -# Run real-setup.py -exec(compile(open("real-setup.py").read().replace('\\r\\n', '\\n'), - __file__, - 'exec')) - |