geepz-pkg 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geepz_pkg-0.1.0.dist-info/METADATA +148 -0
- geepz_pkg-0.1.0.dist-info/RECORD +6 -0
- geepz_pkg-0.1.0.dist-info/WHEEL +5 -0
- geepz_pkg-0.1.0.dist-info/top_level.txt +1 -0
- my_pkg/__init__.py +1 -0
- my_pkg/app.py +6 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: geepz_pkg
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A simple demo app for Python wheel packaging
|
|
5
|
+
Author: Fykio
|
|
6
|
+
Requires-Python: >=3.7
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Dynamic: author
|
|
9
|
+
Dynamic: description
|
|
10
|
+
Dynamic: description-content-type
|
|
11
|
+
Dynamic: requires-python
|
|
12
|
+
Dynamic: summary
|
|
13
|
+
|
|
14
|
+
# My Pkg – Python Wheel Packaging Demo
|
|
15
|
+
|
|
16
|
+
This project demonstrates how to package a Python application into a **wheel (.whl)** file and install it locally as a native package.
|
|
17
|
+
|
|
18
|
+
## Project File Structure
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
my-py-pkg/
|
|
22
|
+
├── README.md
|
|
23
|
+
├── requirements.txt
|
|
24
|
+
├── setup.py
|
|
25
|
+
├── my_pkg/
|
|
26
|
+
│ ├── __init__.py
|
|
27
|
+
│ └── app.py
|
|
28
|
+
└── dist/
|
|
29
|
+
└── (generated .whl file appears here after build)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Stepwise Activities Instruction
|
|
33
|
+
|
|
34
|
+
### 1. Verify Python Environment
|
|
35
|
+
```bash
|
|
36
|
+
# Ensure Python 3 is installed
|
|
37
|
+
python --version
|
|
38
|
+
|
|
39
|
+
# Ensure pip is installed
|
|
40
|
+
pip --version
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Build the Wheel
|
|
44
|
+
```bash
|
|
45
|
+
# Create a virtual environment
|
|
46
|
+
python -m venv venv
|
|
47
|
+
|
|
48
|
+
# Activate the virtual environment
|
|
49
|
+
# For macOS and Linux:
|
|
50
|
+
source venv/bin/activate
|
|
51
|
+
# For Windows:
|
|
52
|
+
venv\Scripts\activate
|
|
53
|
+
|
|
54
|
+
# Install dependencies
|
|
55
|
+
pip install -r requirements.txt
|
|
56
|
+
|
|
57
|
+
# Build the wheel
|
|
58
|
+
python setup.py bdist_wheel
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This generates a `.whl` file inside the `dist/` directory.
|
|
62
|
+
|
|
63
|
+
### 3. Install the Wheel Locally
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install dist/my_pkg-0.1.0-py3-none-any.whl
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This installs the package on your local machine.
|
|
70
|
+
|
|
71
|
+
### 4. Test the Installed Package
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
python -c "from my_pkg.app import greet; greet()"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This should print a greeting message to the console. The expected output is:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Hello from My Pkg!
|
|
81
|
+
Python wheel packaging demo works!
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 5. Simulate Distribution using PyPI
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
twine check dist/*
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This checks the distribution files for any issues before uploading to PyPI. To upload, run:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
twine upload dist/*
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This uploads the distribution files to PyPI. You need an API Key at PyPI to upload. You can create an account at [PyPI User Account](https://pypi.org/account/register/) and generate an API token.
|
|
97
|
+
|
|
98
|
+
### 6. Publish to a Local Nexus Repository
|
|
99
|
+
|
|
100
|
+
Create a PyPI hosted repository in Nexus (for example, `pypi-hosted`) and make sure the Nexus user has permission to upload components. The URL for a local Nexus instance is usually:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
http://localhost:8081/repository/pypi-hosted/
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Set your Nexus username and password in environment variables. Do not commit credentials to this repository.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
export NEXUS_USERNAME=admin
|
|
110
|
+
export NEXUS_PASSWORD='your-nexus-password'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Check and upload the distributions to Nexus:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
twine check dist/*
|
|
117
|
+
|
|
118
|
+
twine upload \
|
|
119
|
+
--repository-url http://localhost:8081/repository/pypi-hosted/ \
|
|
120
|
+
--username "$NEXUS_USERNAME" \
|
|
121
|
+
--password "$NEXUS_PASSWORD" \
|
|
122
|
+
dist/*
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 7. Install from Nexus
|
|
126
|
+
|
|
127
|
+
Install the package from the Nexus PyPI repository:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
pip install \
|
|
131
|
+
--index-url http://localhost:8081/repository/pypi-hosted/simple/ \
|
|
132
|
+
my-pkg==0.1.0
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
For a repository that proxies public PyPI, use Nexus's PyPI group repository URL instead of `pypi-hosted` when installing.
|
|
136
|
+
|
|
137
|
+
### 8. Cleanup: Uninstall the package locally
|
|
138
|
+
```bash
|
|
139
|
+
# Uninstall the package locally
|
|
140
|
+
pip uninstall my_pkg
|
|
141
|
+
|
|
142
|
+
# Deactivate the virtual environment
|
|
143
|
+
deactivate
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
my_pkg/__init__.py,sha256=nowDY8Jk9c6HgWKmu8cR6Iw3iJ3Iph5T6ikoDp5QCCs,35
|
|
2
|
+
my_pkg/app.py,sha256=Enoxp-rF20Tgbfn3MmXYhtcTfM8dwUDhgkPqUh_mecE,136
|
|
3
|
+
geepz_pkg-0.1.0.dist-info/METADATA,sha256=Si_JRHkCoYJxFlgOmul_cggcVxe-PJ02BRpJBqixpZg,3334
|
|
4
|
+
geepz_pkg-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
5
|
+
geepz_pkg-0.1.0.dist-info/top_level.txt,sha256=x2vyTmdUmxZczdVIX1f9Ao9dLtvXJp9WslhzAA1HX-k,7
|
|
6
|
+
geepz_pkg-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
my_pkg
|
my_pkg/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Marks my_pkg as a Python package
|