A small example package
Project description
mattermost-utils

Requirements
- pip package manager
- python version 3.8
Deployment on Linux
- Clone project on your local machine
git clone https://gitlab.tech.orange/dtrs-security/devops/mattermost-utils.git
Usage
Build
Make sure you have the latest versions of setuptools and wheel installed:
python3 -m pip install --user --upgrade setuptools wheel
Now run this command from the same directory where setup.py is located:
python setup.py sdist bdist_wheel
This command should output a lot of text and once completed should generate two files in the dist directory:
dist/
mattermost_post_utils-0.0.1-py3-none-any.whl
mattermost_post_utils-0.0.1.tar.gz
Uploading the distribution archives
The first thing you’ll need to do is register an account on PyPI
Now you’ll create a PyPI API token so you will be able to securely upload your project. Go to https://test.pypi.org/manage/account/#api-tokens and create a new API token; don’t limit its scope to a particular project, since you are creating a new project.
Don’t close the page until you have copied and saved the token — you won’t see that token again.
Now that you are registered, you can use twine to upload the distribution packages. You’ll need to install Twine:
python3 -m pip install --user --upgrade twine
Once installed, run Twine to upload all of the archives under dist:
python3 -m twine upload dist/*
You will be prompted for a username and password. For the username, use token. For the password, use the token value, including the pypi- prefix.
After the command completes, you should see output similar to this:
Uploading distributions to https://pypi.org/legacy/
Enter your username: __token__
Enter your password: <your_token>
Uploading example_pkg_YOUR_USERNAME_HERE-0.0.1-py3-none-any.whl
100%|█████████████████████| 4.65k/4.65k [00:01<00:00, 2.88kB/s]
Uploading example_pkg_YOUR_USERNAME_HERE-0.0.1.tar.gz
100%|█████████████████████| 4.25k/4.25k [00:01<00:00, 3.05kB/s]
Once uploaded your package should be viewable on TestPyPI, for example, https://pypi.org/project/example-pkg-YOUR-USERNAME-HERE
Installing your newly uploaded package
You can use pip to install your package and verify that it works.
python3 -m pip install --no-deps example-pkg-YOUR-USERNAME-HERE
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mattermost_post_utils-0.0.6.tar.gz.
File metadata
- Download URL: mattermost_post_utils-0.0.6.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c79d1867e3dceb2e09dd86569169f6a67ddd12206a31b399faa9f32a6e864f2
|
|
| MD5 |
1524a7e127856fe8d2378754c2fc33fb
|
|
| BLAKE2b-256 |
bae10d4f2b9cbb251e09f21a7a7bea57abc7d60724a7fc0ca5f09931041df761
|
File details
Details for the file mattermost_post_utils-0.0.6-py3-none-any.whl.
File metadata
- Download URL: mattermost_post_utils-0.0.6-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c8579f1fa1b602cd7fdafac26c9335f03885fb6aecb4f57b1ba6d1b37e4ff93
|
|
| MD5 |
bfb0ef9e21de1a9feb9477001a1d901d
|
|
| BLAKE2b-256 |
f69e13d24308485356072592a494c08d787acbbfb10ec784275dfd99b9c5d729
|