A simple test package for PyPI publishing and Amazon Peru testing
Project description
Helin Peru Test Package
A simple Python test package designed for PyPI publishing workflows and Amazon Peru environment testing. This package demonstrates modern Python packaging practices using uv and hatch, with automated GitHub Actions publishing.
Features
- Simple, reliable API for testing package functionality
- Modern Python packaging with uv and hatch
- Automated PyPI publishing via GitHub Actions
- Apache 2.0 open source license
- Python 3.12+ support
Installation
Install from PyPI using pip:
pip install helin-peru-test-package
Or using uv:
uv add helin-peru-test-package
Usage
Basic Usage
from pypi_test_package import hello_peru, get_version
# Get a greeting message
message = hello_peru()
print(message) # Output: "Hello from Peru! This package is working correctly."
# Get the package version
version = get_version()
print(f"Package version: {version}")
Amazon Peru Environment Testing
This package is specifically designed to test functionality in Amazon Peru environments. Here's a complete example for Peru testing:
#!/usr/bin/env python3
"""
Amazon Peru Environment Test Script
This script verifies that the pypi-test-package works correctly in Peru.
"""
import sys
import traceback
from pypi_test_package import hello_peru, get_version
def test_peru_environment():
"""Test package functionality in Amazon Peru environment."""
print("=== PyPI Test Package - Peru Environment Test ===")
print()
try:
# Test 1: Package import
print("✓ Package imported successfully")
# Test 2: Version check
version = get_version()
print(f"✓ Package version: {version}")
# Test 3: Core functionality
greeting = hello_peru()
print(f"✓ Core function result: {greeting}")
# Test 4: Verify expected output
expected_message = "Hello from Peru! This package is working correctly."
if greeting == expected_message:
print("✓ Function output matches expected result")
else:
print(f"✗ Unexpected output. Expected: {expected_message}")
return False
print()
print("🎉 All tests passed! Package is working correctly in Peru environment.")
return True
except Exception as e:
print(f"✗ Error during testing: {e}")
print("Stack trace:")
traceback.print_exc()
return False
def main():
"""Main test execution."""
print(f"Python version: {sys.version}")
print(f"Platform: {sys.platform}")
print()
success = test_peru_environment()
sys.exit(0 if success else 1)
if __name__ == "__main__":
main()
Quick Verification
For a quick test to verify the package is working:
# One-liner test
from pypi_test_package import hello_peru; print(hello_peru())
API Reference
hello_peru() -> str
Returns a greeting message specifically designed for Peru environment testing.
Returns:
str: A greeting message confirming the package is working correctly
Example:
message = hello_peru()
# Returns: "Hello from Peru! This package is working correctly."
get_version() -> str
Returns the current version of the package.
Returns:
str: The package version number
Example:
version = get_version()
# Returns: "0.1.0" (or current version)
Development
Requirements
- Python 3.12+
- uv (for package management)
- hatch (for building)
Setup Development Environment
# Clone the repository
git clone https://github.com/rpidhe/helin-peru-test-package.git
cd helin-peru-test-package
# Install dependencies with uv
uv sync
# Run tests
uv run pytest
# Build the package
uv run hatch build
Running Tests
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src/pypi_test_package
# Run specific test file
uv run pytest tests/test_basic.py
Building and Publishing
This package uses GitHub Actions for automated publishing. To release a new version:
- Update the version in
src/pypi_test_package/__init__.py - Commit your changes
- Create and push a git tag:
git tag v0.1.1 git push origin v0.1.1
- GitHub Actions will automatically build and publish to PyPI
Project Structure
helin-peru-test-package/
├── src/
│ └── pypi_test_package/
│ └── __init__.py # Main package code
├── tests/
│ └── test_basic.py # Unit tests
├── .github/
│ └── workflows/
│ └── publish.yml # GitHub Actions workflow
├── pyproject.toml # Package configuration
├── README.md # This file
├── LICENSE # Apache 2.0 license
└── .gitignore # Git ignore rules
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Apache License 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Support
This is a test package designed for PyPI publishing workflows. For issues or questions:
- Check the Issues page
- Review the documentation above
- Test in your local environment first
Changelog
v0.1.0
- Initial release
- Basic
hello_peru()andget_version()functions - Apache 2.0 license
- GitHub Actions publishing workflow
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 helin_peru_test_package-0.1.0.tar.gz.
File metadata
- Download URL: helin_peru_test_package-0.1.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
591cdd6c49df651da97ac4de7dcb8bad3cfe68ff12d90bb48cd29a0fa18ad7bc
|
|
| MD5 |
629c80fef9a068f1da9e6d6f5ed7977f
|
|
| BLAKE2b-256 |
34474a69b5a2f33afb844decd1c7ad48d2dd4ef8e36b6363225d9363191888d2
|
File details
Details for the file helin_peru_test_package-0.1.0-py3-none-any.whl.
File metadata
- Download URL: helin_peru_test_package-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1324258ff4447548937ee6a52fd3e4c0e27090542e70ec75557668862fb70efa
|
|
| MD5 |
c4b2a7b5d2b77cb3a8a664ff2d245617
|
|
| BLAKE2b-256 |
99c0f45f836ddd5d1249a385695841022507e1916fbd282aafd055f428be55c7
|