- .github
- devel
- doc
-
examples
-
dynamic-client
-
notebooks
-
watch
-
yaml_dir
- README.md
- __init__.py
- annotate_deployment.py
- api_discovery.py
- apply_from_dict.py
- apply_from_directory.py
- apply_from_single_file.py
- cluster_scoped_custom_object.py
- cronjob_crud.py
- deployment_create.py
- deployment_crud.py
- duration-gep2257.py
- in_cluster_config.py
- ingress_create.py
- job_crud.py
- multiple_clusters.py
- namespaced_custom_object.py
- node_labels.py
- out_of_cluster_config.py
- pick_kube_config_context.py
- pod_config_list.py
- pod_exec.py
- pod_portforward.py
- remote_cluster.py
- rollout-daemonset.py
- rollout-statefulset.py
-
dynamic-client
- kubernetes
- scripts
- .gitignore
- CHANGELOG.md
- CONTRIBUTING.md
- LICENSE
- MANIFEST.in
- OWNERS
- README.md
- SECURITY_CONTACTS
- code-of-conduct.md
- codecov.yml
- requirements.txt
- setup.cfg
- setup.py
- test-requirements.txt
- tox.ini
Explanation
This code defines a setup script for a Python package using setuptools
. Let’s break it down:
Package Configuration
CLIENT_VERSION
,PACKAGE_NAME
,DEVELOPMENT_STATUS
: These constants hold essential package information (version, name, development stage). These are likely updated automatically by a script (update-client.sh
) to keep the package version consistent.
Dependencies
EXTRAS
: A dictionary defining optional dependencies that can be installed using extras. For example, you can install the package withpip install kubernetes[adal]
to include the Azure Active Directory Library (ADAL).REQUIRES
: A list of standard required dependencies for the package. This list is populated from therequirements.txt
file.TESTS_REQUIRES
: A list of dependencies needed for testing, read fromtest-requirements.txt
.
Setup Function
The setup()
function from setuptools
is used to configure the package. Here are its key arguments:
name
: The name of the package (kubernetes
).version
: The package version (set fromCLIENT_VERSION
).description
: A brief description of the package.author_email
: The author’s email address (empty in this case).author
: The package author.url
: The package’s URL on GitHub.keywords
: Keywords to help users find the package.install_requires
: The list of required dependencies (fromREQUIRES
).tests_require
: The list of dependencies for testing (fromTESTS_REQUIRES
).extras_require
: The optional dependencies (fromEXTRAS
).packages
: A list of packages to include in the distribution. This specifies the directory structure of the package and ensures all necessary modules are included.include_package_data
: Tells setup to include any data files present in the package directories (e.g., configuration files).long_description
: A more detailed description of the package.python_requires
: Specifies the minimum Python version required to use the package (>=3.6 in this case).classifiers
: Used to categorize the package, making it easier for users to find and choose.
In Summary:
This setup script defines a Python package called kubernetes
with its dependencies and metadata, making it installable and usable with pip
.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph