-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manager-Pypi.py
77 lines (52 loc) · 2.35 KB
/
Manager-Pypi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#*Manager-Pypi - Python
# It sounds like you're asking about managing and publishing packages in the Python Package Index - PyPi.
# Here is a brief overview of the basic concepts and steps:
#? Python Package Index - PyPi:
# PyPi is the official Python package repository. It is the place where developers can share your Python
# packages and libraries with the community.
#? Setuptools and Distutils:
# `Setuptools` is a library that makes it easy to distribute Python packages, and `distutils` is a
# Standard Python module that provides utilities for creating and distributing packages.
#? Creating an Installable Package:
#* 1. **Organize your Package:**
# - Create a directory structure with your modules.
# - Make sure you have a `__init__.py` file in each directory.
# - Add a `setup.py` file to the root directory.
#* 2. **Configure `setup.py`:**
# - Defines the package information (name, version, author, etc.).
# - Specifies the modules or packages to include.
# - List dependencies if any.
from setuptools import setup, find_packages
setup(
name='my_package',
version='0.1',
packages=find_packages(),
install_requires=[
# List of package dependencies
],
)
#* 3. **Create a Distribution File:**
# - Run the following command in the terminal:
#? Command - Bash
# python setup.py sdist
# - This will create a distributable source file in the `dist` directory.
#? Publication in PyPi:
#*1. **Create an Account in PyPi:**
# - [Create an account in PyPI](https://pypi.org/account/register/).
#* 2. **Install `twine`:**
# - `twine` is a tool that simplifies uploading packages to PyPI.
#? Command - Bash
# pip install twine
#* 3. **Upload your Package:**
# - Use `twine` to upload your package to PyPI.
#? Command - Bash
# twine upload dist/*
# - This will upload your package to PyPi.
#* Package Installation:
# Once your package is in PyPI, others can easily install it using `pip`:
#? Command - Bash
# pip install my_package
# These are the basic steps to manage and publish packages in PyPI. Keep in mind that it is a
# simplification, and there are additional tools and best practices for more advanced cases. The official
# documentation for [PyPI](https://pypi.org/) and [Setuptools](https://setuptools.pypa.io/) provides
# detailed information about these processes.