except ImportError: from urllib.request import urlopen from urllib.error import URLError sys.path.append(os.path.abspath(os.path.dirname(__file__))) from setup_support import absolute, build_flags, has_system_lib # Version of libsecp256k1 to download if none exists in the `libsecp256k1` # directory LIB_TARBALL_URL = "https://github.com/bitcoin-core/secp256k1/archive/c5b32e16c4d2560ce829caf88a413fc06fd83d09.tar.gz" # We require setuptools >= 3.3 if [int(i) for i in setuptools_version.split('.')] < [3, 3]: raise SystemExit( "Your setuptools version ({}) is too old to correctly install this " "package. Please upgrade to a newer version (>= 3.3).".format(setuptools_version) ) # Ensure pkg-config is available try: subprocess.check_call(['pkg-config', '--version']) except OSError: raise SystemExit( "'pkg-config' is required to install this package. " "Please see the README for details." )
import time try: from setuptools import setup, __version__ as setuptools_version except ImportError: print( 'You do not have setuptools, and can not install Sopel. The easiest ' 'way to fix this is to install pip by following the instructions at ' 'https://pip.readthedocs.io/en/latest/installing/\n' 'Alternately, you can run Sopel without installing it by running ' '"python sopel.py"', file=sys.stderr, ) sys.exit(1) else: version_info = setuptools_version.split('.') major = int(version_info[0]) minor = int(version_info[1]) if major < 30 or (major == 30 and minor < 3): print( 'Your version of setuptools is outdated: version 30.3 or above ' 'is required to install Sopel. You can do that with ' '"pip install -U setuptools"\n' 'Alternately, you can run Sopel without installing it by running ' '"python sopel.py"', file=sys.stderr, ) sys.exit(1) # We check Python's version ourselves in case someone installed Sopel on an
] extras_require = { 'tests': tests_require, 'docs': docs_require, } below35_requires = [ 'typing', ] below34_requires = [ 'enum34', ] if 'bdist_wheel' not in sys.argv and sys.version_info < (3, 5): install_requires.extend(below35_requires) if tuple(map(int, setuptools_version.split('.'))) < (17, 1): setup_requires = ['setuptools >= 17.1'] extras_require.update({":python_version=='3.4'": below35_requires}) extras_require.update({":python_version=='2.7'": below35_requires}) extras_require.update({":python_version=='2.7'": below34_requires}) else: extras_require.update({":python_version<'3.5'": below35_requires}) extras_require.update({":python_version<'3.4'": below34_requires}) setup(name='nirum', version=get_version(), description='The Nirum runtime library for Python', long_description=readme(), url='https://github.com/spoqa/nirum-python', bugtrack_url='https://github.com/spoqa/nirum/issues', author='Kang Hyojun',
import sys srcdir = os.path.normpath(os.path.join(os.path.dirname(__file__), "src")) if os.path.isfile(os.path.join(srcdir, "rosrepo", "__init__.py")) and os.path.isfile(os.path.join(srcdir, "rosrepo", "main.py")): sys.path.insert(0, srcdir) else: sys.stderr.write("This script is supposed to run from the rosrepo source tree") sys.exit(1) from rosrepo import __version__ as rosrepo_version install_requires = ["catkin_pkg", "catkin_tools", "python-dateutil", "pygit2", "requests", "rosdep", "pyyaml"] extras_require = {} # The following code is a somewhat barbaric attempt to get conditional # dependencies that works on setuptools versions before 18.0 as well: if int(setuptools_version.split(".", 1)[0]) < 18: if sys.version_info[0] < 3: install_requires.append("futures") if sys.version_info[:2] < (3, 5): install_requires.append("scandir") # Unfortunately, the fake conditional dependencies do not work with # the caching mechanism of bdist_wheel, so if you want to create wheels, # use at least setuptools version 18 assert "bdist_wheel" not in sys.argv else: # We have a reasonably modern setuptools version from distutils.version import StrictVersion as Version if Version(setuptools_version) >= Version("36.2"): # Starting with setuptools 36.2, we can do proper conditional # dependencies "PEP 508 style", the way God intended install_requires.append("futures ; python_version<'3'")
from setup_support import absolute, build_flags, detect_dll, has_system_lib # noqa: E402 BUILDING_FOR_WINDOWS = detect_dll() MAKE = 'gmake' if platform.system() in ['FreeBSD', 'OpenBSD'] else 'make' # IMPORTANT: keep in sync with .github/workflows/build.yml # # Version of libsecp256k1 to download if none exists in the `libsecp256k1` directory UPSTREAM_REF = os.getenv( 'COINCURVE_UPSTREAM_REF') or 'd8a246324650c3df8d54d133a8ac3c1b857a7a4e' LIB_TARBALL_URL = f'https://github.com/bitcoin-core/secp256k1/archive/{UPSTREAM_REF}.tar.gz' # We require setuptools >= 3.3 if [int(i) for i in setuptools_version.split('.', 2)[:2]] < [3, 3]: raise SystemExit( 'Your setuptools version ({}) is too old to correctly install this ' 'package. Please upgrade to a newer version (>= 3.3).'.format( setuptools_version)) def download_library(command): if command.dry_run: return libdir = absolute('libsecp256k1') if os.path.exists(os.path.join(libdir, 'autogen.sh')): # Library already downloaded return if not os.path.exists(libdir): command.announce('downloading libsecp256k1 source code',
https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ import platform import sys # Always prefer setuptools over distutils from setuptools import setup, find_packages, __version__ as setuptoolsversion # To use a consistent encoding from codecs import open from os import path #require at least setuptools 20.2 for PEP 508 conditional dependency support MIN_SETUPTOOLS_VERSION = (20, 2) if tuple(int(x) for x in setuptoolsversion.split('.')[:2]) < MIN_SETUPTOOLS_VERSION: sys.exit( 'setuptools %s.%s or later is required. To fix, try running: pip install "setuptools>=%s.%s"' % (MIN_SETUPTOOLS_VERSION * 2) ) here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() with open('requirements.txt', encoding='utf-8') as f: requirements = f.read().splitlines() # Jython cannot handle extremely large blocks of code.
] extras_require = { 'encryption': ['pymongocrypt<2.0.0'], 'ocsp': pyopenssl_reqs, 'snappy': ['python-snappy'], 'tls': [], 'zstd': ['zstandard'], 'aws': ['requests<3.0.0', 'botocore'], } # https://jira.mongodb.org/browse/PYTHON-2117 # Environment marker support didn't settle down until version 20.10 # https://setuptools.readthedocs.io/en/latest/history.html#v20-10-0 _use_env_markers = tuple(map(int, _setuptools_version.split('.')[:2])) > (20, 9) # TLS and DNS extras # We install PyOpenSSL and service_identity for Python < 2.7.9 to # get support for SNI, which is required to connection to Altas # free and shared tier. if sys.version_info[0] == 2: if _use_env_markers: # For building wheels on Python versions >= 2.7.9 for req in pyopenssl_reqs: extras_require['tls'].append("%s ; python_full_version < '2.7.9'" % (req, )) if sys.platform == 'win32': extras_require['tls'].append( "wincertstore>=0.2 ; python_full_version < '2.7.9'") else:
subprocess.check_call([cmake_exe, '.', '-G', 'Unix Makefiles', build_type, pyext_suffix, pylib_dir, python_executable]) if self.parallel: jobs = '-j%d' % self.parallel else: import multiprocessing jobs = '-j%d' % multiprocessing.cpu_count() make_exe = find_executable('make') if not make_exe: raise RuntimeError('Could not find Make executable. Is it installed?') subprocess.check_call([make_exe, jobs, 'retro']) platform_globs = ['*-%s/*' % plat for plat in ['Nes', 'Snes', 'Genesis', 'Atari2600', 'GameBoy', 'Sms', 'GameGear', 'PCEngine', 'GbColor', 'GbAdvance']] kwargs = {} if tuple(int(v) for v in setuptools_version.split('.')) >= (24, 2, 0): kwargs['python_requires'] = '>=3.5.0' setup( name='gym-retro', author='OpenAI', author_email='*****@*****.**', url='https://github.com/openai/retro', version=open(VERSION_PATH, 'r').read(), license='MIT', install_requires=['gym'], ext_modules=[Extension('retro._retro', ['CMakeLists.txt', 'src/*.cpp'])], cmdclass={'build_ext': CMakeBuild}, packages=['retro', 'retro.data', 'retro.data.stable', 'retro.data.experimental', 'retro.data.contrib', 'retro.scripts', 'retro.import'], package_data={ 'retro': ['cores/*.json', 'cores/*_libretro*', 'VERSION.txt', 'README.md', 'LICENSES.md'],
try: from setuptools import (setup, find_packages, __version__ as setuptools_version) except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import (setup, find_packages, __version__ as setuptools_version) from ckan import (__version__, __description__, __long_description__, __license__) MIN_SETUPTOOLS_VERSION = 20.4 assert setuptools_version >= str(MIN_SETUPTOOLS_VERSION) and \ int(setuptools_version.split('.')[0]) >= int(MIN_SETUPTOOLS_VERSION),\ ('setuptools version error' '\nYou need a newer version of setuptools.\n' 'You have {current}, you need at least {minimum}' '\nInstall the recommended version:\n' ' pip install -r requirement-setuptools.txt\n' 'and then try again to install ckan into your python environment.'.format( current=setuptools_version, minimum=MIN_SETUPTOOLS_VERSION )) entry_points = { 'nose.plugins.0.10': [ 'main = ckan.ckan_nose_plugin:CkanNose', ],
# service_identity 18.1.0 introduced support for IP addr matching. pyopenssl_reqs = ["pyopenssl>=17.2.0", "requests<3.0.0", "service_identity>=18.1.0"] extras_require = { 'encryption': ['pymongocrypt<2.0.0'], 'ocsp': pyopenssl_reqs, 'snappy': ['python-snappy'], 'tls': [], 'zstd': ['zstandard'], 'aws': ['requests<3.0.0', 'botocore'], } # https://jira.mongodb.org/browse/PYTHON-2117 # Environment marker support didn't settle down until version 20.10 # https://setuptools.readthedocs.io/en/latest/history.html#v20-10-0 _use_env_markers = tuple(map(int, _setuptools_version.split('.')[:2])) > (20, 9) # TLS and DNS extras # We install PyOpenSSL and service_identity for Python < 2.7.9 to # get support for SNI, which is required to connection to Altas # free and shared tier. if sys.version_info[0] == 2: if _use_env_markers: # For building wheels on Python versions >= 2.7.9 for req in pyopenssl_reqs: extras_require['tls'].append( "%s ; python_full_version < '2.7.9'" % (req,)) if sys.platform == 'win32': extras_require['tls'].append( "wincertstore>=0.2 ; python_full_version < '2.7.9'") else:
import os from sys import version_info, argv as sys_argv from setuptools import setup, __version__ as tools_version README_PATH = 'README.rst' LONG_DESC = '' if os.path.exists(README_PATH): with open(README_PATH) as readme: LONG_DESC = readme.read() INSTALL_REQUIRES = ['Pillow'] EXTRAS_REQUIRE = {} if int(tools_version.split('.', 1)[0]) < 18: assert 'bdist_wheel' not in sys_argv, \ 'bdist_wheel requires setuptools >= 18' if version_info[:2] < (3, 4): INSTALL_REQUIRES.append('enum34') else: EXTRAS_REQUIRE[':python_version<"3.4"'] = ['enum34'] setup( name='pytesseract', version='0.1.8', author='Samuel Hoffstaetter', author_email='*****@*****.**', maintainer='Matthias Lee', maintainer_email='*****@*****.**', description=(
if isinstance(version, tuple): version = '.'.join([str(x) for x in version]) return version install_requires = [ 'setuptools', ] below35_requires = [ 'typing', ] # '<' operator for environment markers are supported since setuptools 17.1. # Read PEP 496 for details of environment markers. setup_requires = ['setuptools >= 17.1'] if tuple(map(int, setuptools_version.split('.'))) < (17, 1): if 'bdist_wheel' not in sys.argv and sys.version_info < (3, 5): install_requires.extend(below35_requires) extras_require = { ':python_version=={0!r}'.format(pyver): below35_requires for pyver in {'3.4', '3.3'} } else: extras_require = { ":python_version<'3.5'": below35_requires, } tests_require = [ 'pytest >= 2.9.0', 'import-order', 'flake8',
from setuptools import __version__, setup if int(__version__.split(".")[0]) < 41: raise RuntimeError("setuptools >= 41 required to build") setup( use_scm_version={ "write_to": "src/virtualenv/version.py", "write_to_template": '__version__ = "{version}"' }, setup_requires=[ # this cannot be enabled until https://github.com/pypa/pip/issues/7778 is addressed # "setuptools_scm >= 2" ], )