Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_version_file():
global version, cwd
print('-- Building version ' + version)
version_path = os.path.join(cwd, 'autogluon', 'version.py')
with open(version_path, 'w') as f:
f.write('"""This is autogluon version file."""\n')
f.write("__version__ = '{}'\n".format(version))
# run test scrip after installation
class install(setuptools.command.install.install):
def run(self):
create_version_file()
setuptools.command.install.install.run(self)
class develop(setuptools.command.develop.develop):
def run(self):
create_version_file()
setuptools.command.develop.develop.run(self)
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
MIN_PYTHON_VERSION = '>=3.6.*'
requirements = [
'numpy>=1.16.0',
'scipy>=1.3.3',
'cython',
def run(self):
def _post_install():
from stringify import stringify_py
stringify_py(source_path='pygame_gui/data',
destination_file='pygame_gui/core/_string_data.py')
atexit.register(_post_install)
develop.run(self)
def run(self):
atexit.register(_execute)
develop.run(self)
def write_script(self, script_name, script, mode="t", blockers=()):
script_name, script = self.transform_script(script_name, script)
_develop.write_script(self, script_name, script, mode, blockers)
os.path.join(root, f) for f in filenames
if not f.endswith('.pyc')]
data_files.append([root, full_filenames])
return data_files
class DevelopDocs(develop):
"""Custom command to require docs dependencies."""
def __init__(self, *args, **kwargs):
global requires
requires += ['sphinx>=1.3.1']
develop.__init__(self, *args, **kwargs)
class DevelopTests(develop):
"""Custom command to require test dependencies."""
def __init__(self, *args, **kwargs):
global requires
requires += [
'pytest>=2.8.0',
'pytest-cov>=2.1.0',
]
develop.__init__(self, *args, **kwargs)
setup(
name='pg-discuss',
version='1.0b1',
description='A comment system backend on top of PostgreSQL',
license='MIT',
import atexit
from setuptools import setup
from setuptools.command.develop import develop
class DevelopOnlyInstall(develop):
def run(self):
def _post_install():
from stringify import stringify_py
stringify_py(source_path='pygame_gui/data',
destination_file='pygame_gui/core/_string_data.py')
atexit.register(_post_install)
develop.run(self)
setup(
cmdclass={'develop': DevelopOnlyInstall},
name='pygame_gui',
version='0.6.0',
description='A GUI module for pygame 2',
def run(self):
develop.run(self)
setup_home()
def run(self):
self.execute(_setup_other_arch, (), msg="Setting up AFL-other-arch")
self.execute(_setup_cgc, (), msg="Setting up AFL-cgc")
self.execute(_setup_libs, (), msg="Getting libraries")
_datafiles()
_develop.run(self)
def custom_develop_command(app_package, app_package_dir, dependencies):
"""
DEPRECATED: Returns a custom develop command class that is tailored for the app calling it.
"""
warnings.warn("The setup script for {} is outdated. Please run 'tethys gen setup' to update it.".format(app_package), DeprecationWarning) # noqa: E501
return develop
""" Override the develop command from setuptools so we can ensure that our
generated files (from build_src or build_scripts) are properly converted to real
files with filenames.
"""
from __future__ import division, absolute_import, print_function
from setuptools.command.develop import develop as old_develop
class develop(old_develop):
__doc__ = old_develop.__doc__
def install_for_development(self):
# Build sources in-place, too.
self.reinitialize_command('build_src', inplace=1)
# Make sure scripts are built.
self.run_command('build_scripts')
old_develop.install_for_development(self)