Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/packages/pypi_repository/index.md')
-rw-r--r--doc/user/packages/pypi_repository/index.md145
1 files changed, 2 insertions, 143 deletions
diff --git a/doc/user/packages/pypi_repository/index.md b/doc/user/packages/pypi_repository/index.md
index fb1b9ce78ab..f6ed9654882 100644
--- a/doc/user/packages/pypi_repository/index.md
+++ b/doc/user/packages/pypi_repository/index.md
@@ -1,6 +1,6 @@
---
stage: Package
-group: Package
+group: Package Registry
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
@@ -20,148 +20,7 @@ The Package Registry works with:
For documentation of the specific API endpoints that the `pip` and `twine`
clients use, see the [PyPI API documentation](../../../api/packages/pypi.md).
-## Build a PyPI package
-
-This section explains how to create a PyPI package.
-
-If you already use PyPI and know how to build your own packages, go to the
-[next section](#authenticate-with-the-package-registry).
-
-### Install pip and twine
-
-Install a recent version of [pip](https://pypi.org/project/pip/) and
-[twine](https://pypi.org/project/twine/).
-
-### Create a project
-
-Create a test project.
-
-1. Open your terminal.
-1. Create a directory called `MyPyPiPackage`, and then go to that directory:
-
- ```shell
- mkdir MyPyPiPackage && cd MyPyPiPackage
- ```
-
-1. Create another directory and go to it:
-
- ```shell
- mkdir mypypipackage && cd mypypipackage
- ```
-
-1. Create the required files in this directory:
-
- ```shell
- touch __init__.py
- touch greet.py
- ```
-
-1. Open the `greet.py` file, and then add:
-
- ```python
- def SayHello():
- print("Hello from MyPyPiPackage")
- return
- ```
-
-1. Open the `__init__.py` file, and then add:
-
- ```python
- from .greet import SayHello
- ```
-
-1. To test the code, in your `MyPyPiPackage` directory, start the Python prompt.
-
- ```shell
- python
- ```
-
-1. Run this command:
-
- ```python
- >>> from mypypipackage import SayHello
- >>> SayHello()
- ```
-
-A message indicates that the project was set up successfully:
-
-```plaintext
-Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
-[Clang 6.0 (clang-600.0.57)] on darwin
-Type "help", "copyright", "credits" or "license" for more information.
->>> from mypypipackage import SayHello
->>> SayHello()
-Hello from MyPyPiPackage
-```
-
-### Create a package
-
-After you create a project, you can create a package.
-
-1. In your terminal, go to the `MyPyPiPackage` directory.
-1. Create a `pyproject.toml` file:
-
- ```shell
- touch pyproject.toml
- ```
-
- This file contains all the information about the package. For more information
- about this file, see [creating `pyproject.toml`](https://packaging.python.org/en/latest/tutorials/packaging-projects/#creating-pyproject-toml).
- Because GitLab identifies packages based on
- [Python normalized names (PEP-503)](https://www.python.org/dev/peps/pep-0503/#normalized-names),
- ensure your package name meets these requirements. See the [installation section](#authenticate-with-a-ci-job-token)
- for details.
-
-1. Open the `pyproject.toml` file, and then add basic information:
-
- ```toml
- [build-system]
- requires = ["setuptools>=61.0"]
- build-backend = "setuptools.build_meta"
-
- [project]
- name = "mypypipackage"
- version = "0.0.1"
- authors = [
- { name="Example Author", email="author@example.com" },
- ]
- description = "A small example package"
- requires-python = ">=3.7"
- classifiers = [
- "Programming Language :: Python :: 3",
- "Operating System :: OS Independent",
- ]
-
- [tool.setuptools.packages]
- find = {}
- ```
-
-1. Save the file.
-1. Install the package build library:
-
- ```shell
- pip install build
- ```
-
-1. Build the package:
-
- ```shell
- python -m build
- ```
-
-The output should be visible in a newly-created `dist` folder:
-
-```shell
-ls dist
-```
-
-The output should appear similar to the following:
-
-```plaintext
-mypypipackage-0.0.1-py3-none-any.whl mypypipackage-0.0.1.tar.gz
-```
-
-The package is now ready to be published to the Package Registry.
+Learn how to [build a PyPI package](../workflows/build_packages.md#pypi).
## Authenticate with the Package Registry