Thanks to visit codestin.com
Credit goes to github.com

Skip to content

In setup.py, inline the packages that need to be installed into setup(). #14170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import os
from zipfile import ZipFile

from setuptools import setup, Extension
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as BuildExtCommand
from setuptools.command.develop import develop as DevelopCommand
from setuptools.command.install_lib import install_lib as InstallLibCommand
Expand Down Expand Up @@ -169,12 +169,7 @@ def run(self):
# however, this is needed on Windows to avoid creating infinite subprocesses
# when using multiprocessing.
if __name__ == '__main__':
# These are distutils.setup parameters that the various packages add
# things to.
packages = []
namespace_packages = []
py_modules = []
package_data = {}
package_data = {} # Will be filled below by the various components.

# If the user just queries for information, don't bother figuring out which
# packages to build or install.
Expand Down Expand Up @@ -224,9 +219,6 @@ def run(self):
# Now collect all of the information we need to build all of the
# packages.
for package in good_packages:
packages.extend(package.get_packages())
namespace_packages.extend(package.get_namespace_packages())
py_modules.extend(package.get_py_modules())
# Extension modules only get added in build_ext, as numpy will have
# been installed (as setup_requires) at that point.
data = package.get_package_data()
Expand Down Expand Up @@ -267,14 +259,14 @@ def run(self):
interfaces and hardcopy output formats.
""",
license="PSF",
packages=packages,
namespace_packages=namespace_packages,
platforms='any',
py_modules=py_modules,
platforms="any",
package_dir={"": "lib"},
packages=find_packages("lib"),
namespace_packages=["mpl_toolkits"],
py_modules=["pylab"],
# Dummy extension to trigger build_ext, which will swap it out with
# real extensions that can depend on numpy for the build.
ext_modules=[Extension("", [])],
package_dir={"": "lib"},
package_data=package_data,
classifiers=classifiers,

Expand Down
37 changes: 0 additions & 37 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os
import pathlib
import platform
import setuptools
import shlex
import shutil
import subprocess
Expand Down Expand Up @@ -310,30 +309,6 @@ def check(self):
"""
pass

def get_packages(self):
"""
Get a list of package names to add to the configuration.
These are added to the `packages` list passed to
`distutils.setup`.
"""
return []

def get_namespace_packages(self):
"""
Get a list of namespace package names to add to the configuration.
These are added to the `namespace_packages` list passed to
`distutils.setup`.
"""
return []

def get_py_modules(self):
"""
Get a list of top-level modules to add to the configuration.
These are added to the `py_modules` list passed to
`distutils.setup`.
"""
return []

def get_package_data(self):
"""
Get a package data dictionary to add to the configuration.
Expand Down Expand Up @@ -485,15 +460,6 @@ class Matplotlib(SetupPackage):
def check(self):
return versioneer.get_version()

def get_packages(self):
return setuptools.find_packages("lib", exclude=["*.tests"])

def get_namespace_packages(self):
return ['mpl_toolkits']

def get_py_modules(self):
return ['pylab']

def get_package_data(self):
return {
'matplotlib': [
Expand Down Expand Up @@ -525,9 +491,6 @@ class Tests(OptionalPackage):
name = "tests"
default_config = False

def get_packages(self):
return setuptools.find_packages("lib", include=["*.tests"])

def get_package_data(self):
return {
'matplotlib': [
Expand Down