A simple test package that prints hello world during installation
Project description
ldaputil
A simple test Python package that prints "Hello World" during installation.
Description
This is a minimal test package created to demonstrate Python packaging. The package doesn't provide any real functionality - it's designed to print a greeting message when installed and imported.
Installation
From PyPI (when published):
pip install ldaputil
From local build:
pip install dist/ldaputil-40.0.0-py3-none-any.whl
Usage
import ldaputil
# The package will print "Hello World" message when imported
# You can also use the hello_world function
ldaputil.hello_world()
# Or use the greet function from main module
from ldaputil.main import greet
greet("Python Developer")
Features
- Prints greeting message during installation/import
- Simple hello_world() function
- Greet function with customizable name
- Minimal dependencies
Development
Prerequisites
- Python 3.8+
- Virtual environment (recommended)
Setup Development Environment
-
Clone the repository:
git clone <repository-url> cd ldaputil
-
Create and activate virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install development dependencies:
pip install --upgrade pip build twine pytest
Building the Package
-
Clean previous builds:
rm -rf dist/ build/ src/*.egg-info/
-
Build the package:
python -m build
This creates two files in
dist/:ldaputil-40.0.0.tar.gz(source distribution)ldaputil-40.0.0-py3-none-any.whl(wheel distribution)
-
Verify the build:
twine check dist/*
Testing
-
Run unit tests:
python -m pytest tests/ -v
-
Test local installation:
pip install dist/ldaputil-40.0.0-py3-none-any.whl python -c "import ldaputil; ldaputil.hello_world()"
Publishing to PyPI
Option 1: Test on TestPyPI first (Recommended)
-
Create account on TestPyPI:
- Go to https://test.pypi.org/account/register/
- Verify your email address
-
Create API token:
- Go to https://test.pypi.org/manage/account/#api-tokens
- Create token with "Entire account" scope
- Copy the token (starts with
pypi-)
-
Upload to TestPyPI:
twine upload --repository testpypi dist/*
- Enter your API token when prompted
-
Test installation from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ ldaputil
Option 2: Publish to Production PyPI
-
Create account on PyPI:
- Go to https://pypi.org/account/register/
- Verify your email address
-
Create API token:
- Go to https://pypi.org/manage/account/#api-tokens
- Create token with "Entire account" scope
- Copy the token (starts with
pypi-)
-
Upload to PyPI:
twine upload dist/*
- Enter your API token when prompted
-
Verify publication:
- Visit https://pypi.org/project/ldaputil/
- Install:
pip install ldaputil
Version Management
To release a new version:
-
Update version in
pyproject.toml:version = "40.0.1" # or next version
-
Rebuild and republish:
rm -rf dist/ python -m build twine check dist/* twine upload dist/* # or --repository testpypi for testing
Troubleshooting
Common Issues:
-
"Package already exists" error:
- You cannot upload the same version twice
- Increment the version number in
pyproject.toml
-
Authentication errors:
- Make sure you're using the correct API token
- Token should start with
pypi-
-
Build errors:
- Make sure you're in the virtual environment
- Check that all dependencies are installed
Useful Commands:
# Check package contents
tar -tzf dist/ldaputil-40.0.0.tar.gz
# Install in development mode
pip install -e .
# Uninstall package
pip uninstall ldaputil
# View package info
pip show ldaputil
Project Structure
ldaputil/
├── src/ldaputil/
│ ├── __init__.py # Main module with hello_world()
│ └── main.py # Additional functions
├── tests/
│ ├── __init__.py
│ └── test_ldaputil.py # Unit tests
├── dist/ # Built packages (created by build)
├── pyproject.toml # Package configuration
├── README.md # This file
└── LICENSE # MIT License
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 ldaputil-30.2.0.tar.gz.
File metadata
- Download URL: ldaputil-30.2.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae4b1fda8cef3b3a4e348838986bec2d16a7081f7fe7f6b9638577cec17974f9
|
|
| MD5 |
a60114a0da8fb774da422cb2893204e1
|
|
| BLAKE2b-256 |
9f8583883083b18e7d413fe9f093bf060707b6b30ec181555c300c0d8dadce23
|
File details
Details for the file ldaputil-30.2.0-py3-none-any.whl.
File metadata
- Download URL: ldaputil-30.2.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22579ed41aab7bc73da29764518624ef00fc687b39ecb910c6b86cc8b4a36a1a
|
|
| MD5 |
2a585feacbc113b1fd671ec39e250d24
|
|
| BLAKE2b-256 |
2adc6b137685a1e52441fecd7b9d3ccf14c771098259d2e57a54da8fe090d731
|