Skip to main content

No project description provided

Project description

Python build & test

Desert Tortoise Digital Pet Package

This package was created by following Packaging Python Projects with pipenv for virtual environment and dependency management. It provides a playful ASCII-art digital pet system where users can adopt pets from a shelter, feed them, play with them, put them to sleep, and inspect their status.

How this package was created

  1. Set up project files including LICENSE, README.md, Pipfile, pyproject.toml, source package directory, and tests.
  2. Implemented an abstract base class for shared pet behavior and concrete species classes.
  3. Added a shared shelter module to manage species inventory and adoption/return flows.
  4. Added unit tests using pytest.
  5. Added GitHub Actions CI to run tests on pull requests to main for Python 3.11 and 3.12.
  6. Configured package metadata in pyproject.toml.

Current high-level structure:

3-package-desert_tortoise/
	|____README.md
	|____LICENSE
	|____Pipfile
	|____pyproject.toml
	|____example.py
	|____tests/
	|____desert_tortoise/
			|______init__.py
			|____pet.py
			|____parrot.py
			|____bunny.py
			|____cat.py
			|____dog.py
			|____tortoise.py
			|____shelter.py

PyPI Website

Our Package's PyPI Website

How to install and use this package

Install from PyPI

pip install desert-tortoise-pet-package

Local development install

git clone https://github.com/swe-students-spring2026/3-package-desert_tortoise.git
cd 3-package-desert_tortoise
pipenv install --dev
pipenv run pip install -e .

Basic usage

from desert_tortoise import Parrot

pet = Parrot.adopt("Kiwi")
pet.feed("seeds", 2)
pet.play("mirror")
pet.sleep(1)
print(pet.status())

Full example program

The complete example that demonstrates all current pet classes is in example.py.

Run it with:

pipenv run python example.py

API overview

Each pet class supports the following argument-driven functions:

  1. adopt(name: str)
  2. feed(food_type: str, amount: int = 1)
  3. play(type_of_toy: str)
  4. sleep(time: int = 5)
  5. status()

Available classes exported by the package:

  • Parrot
  • Bunny
  • Cat
  • Dog
  • Tortoise

Shared shelter helper module:

  • shelter.has_available(species)
  • shelter.adopt_one(species)
  • shelter.return_one(species, default_name)
  • shelter.snapshot()

How to run unit tests

pipenv install --dev
pipenv run pytest -q

Tests should not fail. Any failing test indicates behavior mismatch or a regression.

How to build and publish

Install build tools:

pipenv install --dev build twine

Build distributions:

pipenv run python -m build

Verify package files:

tar --list -f dist/desert_tortoise_pet_package-1.0.0.tar.gz

Upload to TestPyPI:

pipenv run twine upload -r testpypi dist/*

Upload to PyPI:

pipenv run twine upload dist/*

When releasing a new version:

  1. Delete dist directory.
  2. Delete generated egg-info metadata if present.
  3. Bump version in pyproject.toml.
  4. Rebuild and upload again.

Continuous integration

This repository uses GitHub Actions to run tests on pull requests into main using Python 3.11 and 3.12.

Workflow file:

  • .github/workflows/build.yml

Contribution workflow

  1. Create a feature branch from main.
  2. Implement changes and tests.
  3. Open a pull request into main.
  4. Request teammate review.
  5. Merge after review and passing CI.

Team Member

Environment variables and secret files

No environment variables or secret configuration files are required for the current implementation.

If this changes in the future, include an env.example file with dummy values and document setup steps here.

License

MIT License. See License 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

desert_tortoise_virtual_pet_package-1.0.2.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file desert_tortoise_virtual_pet_package-1.0.2.tar.gz.

File metadata

File hashes

Hashes for desert_tortoise_virtual_pet_package-1.0.2.tar.gz
Algorithm Hash digest
SHA256 372831183bb76089b595725e4fd252204644a8d38b20174483f1837afe88db29
MD5 8ca9c6abb43ed7ea7feda1c00f10f428
BLAKE2b-256 e7aebae9c1fc461dc24fc7f3147fe54f6243b402a4b34d167a5977ea3ee6a237

See more details on using hashes here.

File details

Details for the file desert_tortoise_virtual_pet_package-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for desert_tortoise_virtual_pet_package-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 79e58a0b8cba04fbbcdfb81f0a235179efbfb42a0b4b58775ff441e26064d3b6
MD5 68aa09101369e0c337cf05be5f284dfb
BLAKE2b-256 202f08c95fa0a93f3b4b32df9518018e0d9713bbaa5af8f78a586c518874cb70

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