Skip to main content

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

  1. Clone the repository:

    git clone <repository-url>
    cd ldaputil
    
  2. Create and activate virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install development dependencies:

    pip install --upgrade pip build twine pytest
    

Building the Package

  1. Clean previous builds:

    rm -rf dist/ build/ src/*.egg-info/
    
  2. 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)
  3. Verify the build:

    twine check dist/*
    

Testing

  1. Run unit tests:

    python -m pytest tests/ -v
    
  2. 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)

  1. Create account on TestPyPI:

  2. Create API token:

  3. Upload to TestPyPI:

    twine upload --repository testpypi dist/*
    
    • Enter your API token when prompted
  4. Test installation from TestPyPI:

    pip install --index-url https://test.pypi.org/simple/ ldaputil
    

Option 2: Publish to Production PyPI

  1. Create account on PyPI:

  2. Create API token:

  3. Upload to PyPI:

    twine upload dist/*
    
    • Enter your API token when prompted
  4. Verify publication:

Version Management

To release a new version:

  1. Update version in pyproject.toml:

    version = "40.0.1"  # or next version
    
  2. Rebuild and republish:

    rm -rf dist/
    python -m build
    twine check dist/*
    twine upload dist/*  # or --repository testpypi for testing
    

Troubleshooting

Common Issues:

  1. "Package already exists" error:

    • You cannot upload the same version twice
    • Increment the version number in pyproject.toml
  2. Authentication errors:

    • Make sure you're using the correct API token
    • Token should start with pypi-
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ldaputil-30.2.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ldaputil-30.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for ldaputil-30.2.0.tar.gz
Algorithm Hash digest
SHA256 ae4b1fda8cef3b3a4e348838986bec2d16a7081f7fe7f6b9638577cec17974f9
MD5 a60114a0da8fb774da422cb2893204e1
BLAKE2b-256 9f8583883083b18e7d413fe9f093bf060707b6b30ec181555c300c0d8dadce23

See more details on using hashes here.

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

Hashes for ldaputil-30.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 22579ed41aab7bc73da29764518624ef00fc687b39ecb910c6b86cc8b4a36a1a
MD5 2a585feacbc113b1fd671ec39e250d24
BLAKE2b-256 2adc6b137685a1e52441fecd7b9d3ccf14c771098259d2e57a54da8fe090d731

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page