Python setuptools.find_packages() Examples

The following are 30 code examples of setuptools.find_packages(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module setuptools , or try the search function .
Example #1
Source File: setup.py    From Deep-Learning-with-TensorFlow-Second-Edition with MIT License 7 votes vote down vote up
def main():
    setup(
        name='tffm',
        version='1.0.0a1',
        author="Mikhail Trofimov",
        author_email="mikhail.trofimov@phystech.edu",
        url='https://github.com/geffy/tffm',
        description=('TensforFlow implementation of arbitrary order '
                     'Factorization Machine'),
        classifiers=[
            'Development Status :: 3 - Alpha',
            'Intended Audience :: Science/Research',
            'Topic :: Scientific/Engineering',
            'License :: OSI Approved :: MIT License',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
        ],
        license='MIT',
        install_requires=[
            'scikit-learn',
            'numpy',
            'tqdm'
        ],
        packages=find_packages()
    ) 
Example #2
Source File: config.py    From python-netsurv with MIT License 6 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directive = 'find:'

        if not value.startswith(find_directive):
            return self._parse_list(value)

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #3
Source File: setup.py    From mobly with Apache License 2.0 6 votes vote down vote up
def main():
    setuptools.setup(
        name='mobly',
        version='1.10',
        maintainer='Ang Li',
        maintainer_email='mobly-github@googlegroups.com',
        description='Automation framework for special end-to-end test cases',
        license='Apache2.0',
        url='https://github.com/google/mobly',
        download_url='https://github.com/google/mobly/tarball/1.10',
        packages=setuptools.find_packages(exclude=['tests']),
        include_package_data=False,
        scripts=['tools/sl4a_shell.py', 'tools/snippet_shell.py'],
        tests_require=[
            'mock',
            # Needed for supporting Python 2 because this release stopped supporting Python 2.
            'pytest<5.0.0',
            'pytz',
        ],
        install_requires=install_requires,
        cmdclass={'test': PyTest},
    ) 
Example #4
Source File: test_doctest.py    From pytest with MIT License 6 votes vote down vote up
def test_valid_setup_py(self, testdir):
        """
        Test to make sure that pytest ignores valid setup.py files when ran
        with --doctest-modules
        """
        p = testdir.makepyfile(
            setup="""
            from setuptools import setup, find_packages
            setup(name='sample',
                  version='0.0',
                  description='description',
                  packages=find_packages()
            )
        """
        )
        result = testdir.runpytest(p, "--doctest-modules")
        result.stdout.fnmatch_lines(["*collected 0 items*"]) 
Example #5
Source File: setup.py    From ccs-twistedextensions with Apache License 2.0 6 votes vote down vote up
def find_packages():
    modules = [
        "twisted.plugins",
    ]

    def is_package(path):
        return (
            os.path.isdir(path) and
            os.path.isfile(os.path.join(path, "__init__.py"))
        )

    for pkg in filter(is_package, os.listdir(".")):
        modules.extend([pkg, ] + [
            "{}.{}".format(pkg, subpkg)
            for subpkg in setuptools_find_packages(pkg)
        ])
    return modules 
Example #6
Source File: setup.py    From fftoptionlib with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def main():
    setup(name='fftoptionlib',
          version=__version__,
          author='ArrayStream (Yu Zheng, Ran Fan)',
          author_email='team@arraystream.com',
          url='https://github.com/arraystream/fftoptionlib',
          description='FFT-based Option Pricing Method in Python',
          long_description='FFT-based Option Pricing Method in Python',
          classifiers=[
              'Development Status :: 5 - Production/Stable',
              'Programming Language :: Python :: 3',
              'Programming Language :: Python :: 3.3',
              'Programming Language :: Python :: 3.4',
              'Programming Language :: Python :: 3.5',
              'Topic :: Scientific/Engineering :: Mathematics',
              'Intended Audience :: Financial and Insurance Industry'
          ],
          license='BSD',
          packages=find_packages(include=['fftoptionlib']),
          install_requires=['numpy', 'scipy', 'pandas', 'autograd'],
          platforms='any') 
Example #7
Source File: config.py    From python-netsurv with MIT License 6 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directive = 'find:'

        if not value.startswith(find_directive):
            return self._parse_list(value)

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #8
Source File: setup.py    From peony-twitter with MIT License 6 votes vote down vote up
def main():
    if sys.version_info < (3, 5, 3):
        raise RuntimeError("Peony requires Python 3.5.3+")

    dirname = os.path.dirname(inspect.getfile(inspect.currentframe()))

    # get metadata and keywords from peony/__init__.py
    kwargs = get_metadata(os.path.join(dirname, 'peony', '__init__.py'))

    # get requirements from requirements.txt
    kwargs.update(get_requirements(os.path.join(dirname, 'requirements.txt')))

    # get extras requirements from extras_require.txt
    extras = os.path.join(dirname, 'extras_require.txt')
    extras_require = get_requirements(extras)

    # get long description from README.md
    with open('README.rst') as stream:
        long_description = stream.read()

    setup(long_description=long_description,
          packages=find_packages(include=["peony*"]),
          extras_require=extras_require,
          python_requires='>=3.5.3',
          **kwargs) 
Example #9
Source File: config.py    From telegram-robot-rss with Mozilla Public License 2.0 6 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directive = 'find:'

        if not value.startswith(find_directive):
            return self._parse_list(value)

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #10
Source File: config.py    From Safejumper-for-Desktop with GNU General Public License v2.0 6 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directive = 'find:'

        if not value.startswith(find_directive):
            return self._parse_list(value)

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #11
Source File: setup.py    From pylti with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def convert_path(pathname):
        """
        Local copy of setuptools.convert_path used by find_packages (only used
        with distutils which is missing the find_packages feature)
        """
        if os.sep == '/':
            return pathname
        if not pathname:
            return pathname
        if pathname[0] == '/':
            raise ValueError("path '%s' cannot be absolute" % pathname)
        if pathname[-1] == '/':
            raise ValueError("path '%s' cannot end with '/'" % pathname)
        paths = string.split(pathname, '/')
        while '.' in paths:
            paths.remove('.')
        if not paths:
            return os.curdir
        return os.path.join(*paths) 
Example #12
Source File: setup.py    From pylti with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def find_packages(where='.', exclude=()):
        """
        Local copy of setuptools.find_packages (only used with distutils which
        is missing the find_packages feature)
        """
        out = []
        stack = [(convert_path(where), '')]
        while stack:
            where, prefix = stack.pop(0)
            for name in os.listdir(where):
                fn = os.path.join(where, name)
                isdir = os.path.isdir(fn)
                has_init = os.path.isfile(os.path.join(fn, '__init__.py'))
                if '.' not in name and isdir and has_init:
                    out.append(prefix + name)
                    stack.append((fn, prefix + name + '.'))
        for pat in list(exclude) + ['ez_setup', 'distribute_setup']:
            from fnmatch import fnmatchcase

            out = [item for item in out if not fnmatchcase(item, pat)]
        return out 
Example #13
Source File: config.py    From anpr with Creative Commons Attribution 4.0 International 6 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directive = 'find:'

        if not value.startswith(find_directive):
            return self._parse_list(value)

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #14
Source File: setup.py    From hue-python-rgb-converter with MIT License 6 votes vote down vote up
def setup_package():
    # Some helper variables
    version = VERSION

    install_reqs=[],

    setup(
        name=NAME,
        version=version,
        url=URL,
        description=DESCRIPTION,
        author=AUTHOR,
        author_email=EMAIL,
        license=LICENSE,
        keywords='philips hue light rgb xy',
        packages=setuptools.find_packages(),
        install_requires=install_reqs
    ) 
Example #15
Source File: setup.py    From ucloud-sdk-python3 with Apache License 2.0 5 votes vote down vote up
def do_setup():
    setup(
        name="ucloud-sdk-python3",
        description="UCloud Service Development Kit - Python",
        long_description=load_long_description(),
        long_description_content_type="text/markdown",
        license="Apache License 2.0",
        version=load_version(),
        packages=find_packages(exclude=["tests*"]),
        package_data={"": []},
        include_package_data=True,
        zip_safe=False,
        install_requires=dependencies,
        extras_require={
            "test": dependencies_test,
            "doc": dependencies_doc,
            "dev": dependencies_dev,
            "ci": dependencies_ci,
        },
        dependencies_test=dependencies_test,
        classifiers=[
            "Development Status :: 3 - Alpha",
            "Environment :: Console",
            "Environment :: Web Environment",
            "Intended Audience :: Developers",
            "Intended Audience :: System Administrators",
            "License :: OSI Approved :: Apache Software License",
            "Programming Language :: Python :: 3 :: Only",
            "Programming Language :: Python :: 3.5",
            "Programming Language :: Python :: 3.6",
            "Programming Language :: Python :: 3.7",
            "Topic :: Software Development",
        ],
        author="ucloud",
        author_email="esl_ipdd@ucloud.cn",
        url="https://github.com/ucloud/ucloud-sdk-python3",
        python_requires=">=3.5",
    ) 
Example #16
Source File: setup_boilerplate.py    From vecto with Mozilla Public License 2.0 5 votes vote down vote up
def prepare(cls) -> None:
        """Fill in possibly missing package metadata."""
        if cls.version is None:
            cls.version = find_version(cls.name)
        if cls.long_description is None:
            cls.long_description = cls.parse_readme()
        if cls.packages is None:
            cls.packages = find_packages(cls.root_directory)
        if cls.install_requires is None:
            cls.install_requires = parse_requirements()
        if cls.python_requires is None:
            cls.python_requires = find_required_python_version(cls.classifiers) 
Example #17
Source File: setup.py    From flaky with Apache License 2.0 5 votes vote down vote up
def main():
    base_dir = dirname(__file__)
    setup(
        name='flaky',
        version='3.6.1',
        description='Plugin for nose or pytest that automatically reruns flaky tests.',
        long_description=open(join(base_dir, 'README.rst')).read(),
        author='Box',
        author_email='oss@box.com',
        url='https://github.com/box/flaky',
        license='Apache Software License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0',
        packages=find_packages(exclude=['test*']),
        test_suite='test',
        tests_require=['tox'],
        cmdclass={'test': Tox},
        zip_safe=False,
        entry_points={
            'nose.plugins.0.10': [
                'flaky = flaky.flaky_nose_plugin:FlakyPlugin'
            ],
            'pytest11': [
                'flaky = flaky.flaky_pytest_plugin'
            ]
        },
        keywords='nose pytest plugin flaky tests rerun retry',
        python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
        classifiers=CLASSIFIERS,
    ) 
Example #18
Source File: setup.py    From civis-python with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def main():
    with open('README.rst') as README_FILE:
        README = README_FILE.read()

    setup(
        classifiers=CLASSIFIERS,
        name="civis",
        version=get_version(),
        author="Civis Analytics Inc",
        author_email="opensource@civisanalytics.com",
        url="https://www.civisanalytics.com",
        description="Access the Civis Platform API",
        packages=find_packages(),
        include_package_data=True,
        data_files=[(os.path.join('civis', 'tests'),
                     glob(os.path.join('civis', 'tests', '*.json')))],
        long_description=README,
        long_description_content_type="text/x-rst",
        install_requires=[
            'pyyaml>=3.0,<=5.99',
            'click>=6.0,<=7.99',
            'jsonref>=0.1.0,<=0.2.99',
            'requests>=2.12.0,==2.*',
            'jsonschema>=2.5.1,<=3.99',
            'joblib>=0.11,<0.15',
            'pubnub>=4.1.12,<=4.99',
            'cloudpickle>=0.2.0,<2',
        ],
        entry_points={
            'console_scripts': [
                'civis = civis.cli.__main__:main',
                'civis_joblib_worker = civis.run_joblib_func:main',
            ]
        }
    ) 
Example #19
Source File: setup.py    From kryptoflow with GNU General Public License v3.0 5 votes vote down vote up
def setup_package():
    setup(version='0.5.1',
          include_package_data=True,
          install_requires=install_requires,
          tests_require=extras('test.txt'),
          extras_require=extras_require(),
          keywords=[
              'kryptoflow',
              'tensorFlow',
              'deep-learning',
              'machine-learning',
              'data-science',
              'bitcoin',
              'kafka',
              'time-series'
          ],
          entry_points={"console_scripts": [
                  "kryptoflow = kryptoflow.main:cli",
              ],
          },
          classifiers=[
              'Programming Language :: Python',
              'Operating System :: OS Independent',
              'Intended Audience :: Developers',
              'Intended Audience :: Science/Research',
              'Topic :: Scientific/Engineering :: Artificial Intelligence'
          ],
          # dependency_links=['https://github.com/Supervisor/supervisor/tarball/master#egg=supervisor-4.0.0.dev',
          #                   'https://github.com/carlomazzaferro/coinbasepro-python/tarball/master#egg=coinbasepro-python-1.1.2'],
          dependency_links=['git+git://github.com/Supervisor/supervisor.git@master#egg=supervisor-4.0.0.dev'],


          packages=find_packages(),
          ) 
Example #20
Source File: config.py    From scylla with Apache License 2.0 5 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directives = ['find:', 'find_namespace:']
        trimmed_value = value.strip()

        if trimmed_value not in find_directives:
            return self._parse_list(value)

        findns = trimmed_value == find_directives[1]
        if findns and not PY3:
            raise DistutilsOptionError(
                'find_namespace: directive is unsupported on Python < 3.3')

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        if findns:
            from setuptools import find_namespace_packages as find_packages
        else:
            from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #21
Source File: config.py    From stopstalk-deployment with MIT License 5 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directives = ['find:', 'find_namespace:']
        trimmed_value = value.strip()

        if not trimmed_value in find_directives:
            return self._parse_list(value)

        findns = trimmed_value == find_directives[1]
        if findns and not PY3:
            raise DistutilsOptionError('find_namespace: directive is unsupported on Python < 3.3')

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        if findns:
            from setuptools import find_namespace_packages as find_packages
        else:
            from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #22
Source File: cloud_mlengine.py    From fine-lm with MIT License 5 votes vote down vote up
def get_setup_file(name, packages=None):
  if not packages:
    packages = []
  return """
from setuptools import find_packages
from setuptools import setup
setup(
    name="{name}",
    version="0.1",
    packages=find_packages(),
    install_requires={pypi_packages}
)
""".format(name=name, pypi_packages=str(list(packages))) 
Example #23
Source File: cloud_mlengine.py    From training_results_v0.5 with Apache License 2.0 5 votes vote down vote up
def get_setup_file(name, packages=None):
  if not packages:
    packages = []
  return """
from setuptools import find_packages
from setuptools import setup
setup(
    name="{name}",
    version="0.1",
    packages=find_packages(),
    install_requires={pypi_packages}
)
""".format(name=name, pypi_packages=str(list(packages))) 
Example #24
Source File: setup.py    From py-googletrans with MIT License 5 votes vote down vote up
def install():
    setup(
        name='googletrans',
        version=get_version(),
        description=get_description(),
        long_description=get_readme(),
        license='MIT',
        author='SuHun Han',
        author_email='ssut' '@' 'ssut.me',
        url='https://github.com/ssut/py-googletrans',
        classifiers=['Development Status :: 5 - Production/Stable',
                     'Intended Audience :: Education',
                     'Intended Audience :: End Users/Desktop',
                     'License :: Freeware',
                     'Operating System :: POSIX',
                     'Operating System :: Microsoft :: Windows',
                     'Operating System :: MacOS :: MacOS X',
                     'Topic :: Education',
                     'Programming Language :: Python',
                     'Programming Language :: Python :: 3.6',
                     'Programming Language :: Python :: 3.7',
                     'Programming Language :: Python :: 3.8'],
        packages=find_packages(exclude=['docs', 'tests']),
        keywords='google translate translator',
        install_requires=[
            'httpx==0.13.3',
        ],
        tests_require=[
            'pytest',
            'coveralls',
        ],
        scripts=['translate']
    ) 
Example #25
Source File: setup.py    From yaml_cli with MIT License 5 votes vote down vote up
def params():
	name = 'yaml_cli'  # This is the name of your PyPI-package.
	version = __version__
	# scripts = ['helloworld']  # The name of your scipt, and also the command you'll be using for calling it
	description = "A command line interface to read and manipulate YAML files. Based on python, distributed as pip."
	author = "Andy Werner"
	author_email = "andy@mr-beam.org"
	url = "https://github.com/Gallore/yaml_cli"
	# license = "proprietary"

	packages = find_packages()
	zip_safe = False # ?

	install_requires = [
		"PyYAML",
		"argparse"
	]

	entry_points = {
		"console_scripts": {
			"yaml_cli = yaml_cli.__init__:run"
		}
	}

	# non python files need to be specified in MANIFEST.in
	include_package_data = True

	return locals() 
Example #26
Source File: setup.py    From pymerkle with GNU General Public License v3.0 5 votes vote down vote up
def main():
    setup(
       name=pymerkle.__name__,
       version=pymerkle.__version__,
       description=pymerkle.__doc__.strip(),
       long_description=long_description,
       long_description_content_type='text/markdown',
       packages=find_packages(),
       # package_dir={'': 'pymerkle'},
       url=URL,
       project_urls={
            "github": URL,
            "source": "%s/%s" % (URL, "tree/master/%s" % pymerkle.__name__),
            "docs": "https://%s.readthedocs.io/en/latest/" % pymerkle.__name__,
       },
       author="FoteinosMerg",
       author_email="foteinosmerg@protonmail.com",
       python_requires=">=3.6",
       install_requires=install_requires,
       zip_safe=False,
       keywords=[
           "merkle", "proof", "audit", "consistency",
       ],
       classifiers=[
           "Development Status :: 4 - Beta",
           "Intended Audience :: Developers",
           "Intended Audience :: Science/Research",
           "Programming Language :: Python :: 3.6",
           "Operating System :: POSIX",
           "Topic :: Security :: Cryptography",
           "Topic :: Software Development :: Libraries :: Python Modules",
           "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
       ],
    ) 
Example #27
Source File: config.py    From Mastering-Elasticsearch-7.0 with MIT License 5 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directives = ['find:', 'find_namespace:']
        trimmed_value = value.strip()

        if trimmed_value not in find_directives:
            return self._parse_list(value)

        findns = trimmed_value == find_directives[1]
        if findns and not PY3:
            raise DistutilsOptionError(
                'find_namespace: directive is unsupported on Python < 3.3')

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        if findns:
            from setuptools import find_namespace_packages as find_packages
        else:
            from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #28
Source File: setup_boilerplate.py    From vecto with Mozilla Public License 2.0 5 votes vote down vote up
def find_packages(root_directory: str = '.') -> t.List[str]:
    """Find packages to pack."""
    exclude = ['test*', 'test.*'] if ('bdist_wheel' in sys.argv or 'bdist' in sys.argv) else []
    packages_list = setuptools.find_packages(root_directory, exclude=exclude)
    return packages_list 
Example #29
Source File: config.py    From deepWordBug with Apache License 2.0 5 votes vote down vote up
def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directives = ['find:', 'find_namespace:']
        trimmed_value = value.strip()

        if trimmed_value not in find_directives:
            return self._parse_list(value)

        findns = trimmed_value == find_directives[1]
        if findns and not PY3:
            raise DistutilsOptionError(
                'find_namespace: directive is unsupported on Python < 3.3')

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {}))

        if findns:
            from setuptools import find_namespace_packages as find_packages
        else:
            from setuptools import find_packages

        return find_packages(**find_kwargs) 
Example #30
Source File: setup.py    From plio with The Unlicense 5 votes vote down vote up
def setup_package():
    setup(
        name = "plio",
        version = '1.2.2',
        author = "Jay Laura",
        author_email = "jlaura@usgs.gov",
        description = ("I/O API to support planetary data formats."),
        long_description = long_description,
        license = "Public Domain",
        keywords = "planetary io",
        url = "http://packages.python.org/plio",
        packages=find_packages(),
        include_package_data=True,
        package_data={'plio' : ['sqlalchemy_json/*.py', 'sqlalchemy_json/LICENSE']},
        zip_safe=True,
        scripts=['bin/socetnet2isis', 'bin/isisnet2socet'],
        install_requires=[
            'gdal',
            'numpy',
            'pyproj',
            'jinja2',
            'pvl',
            'protobuf',
            'h5py',
            'pandas',
            'sqlalchemy',
            'pyyaml',
            'networkx',
            'affine',
            'scipy'],
        classifiers=[
            "Development Status :: 3 - Alpha",
            "Topic :: Utilities",
            "License :: Public Domain",
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Programming Language :: Python :: 3.5',
        ],
    )