This is a simple Python project that prints "Hello, World!" using Poetry for dependency management.
It also includes ruff, a fast Python linter, and a pre-commit hook setup to ensure code quality.
checkout-ruff/
├── checkout_ruff/
│ └── hello_world.py # Main application code
│ └── __init__.py
├── tests/
│ └── test_hello_world.py # Test code
├── pyproject.toml # Poetry configuration file
├── poetry.lock # Locked dependencies
├── Dockerfile # Docker configuration
├── .dockerignore # Docker ignore file
├── .pre-commit-config.yaml # Pre-commit configuration
├── ruff.toml # Ruff configuration
└── README.md # Project documentation
First, install Poetry if you haven't already:
python -m pip install poetryThen, install the project dependencies:
poetry install --no-rootTo build the Docker image:
docker build -t checkout-ruff .To run the Docker container:
docker run --rm checkout-ruffTo run the project:
poetry run python -m checkout_ruffTo run the tests:
poetry run pytestRuff is a fast Python linter, written in Rust. It is designed to provide linting and code quality checks for Python codebases. Using Ruff helps maintain consistent code style and catch potential errors before they make it into your codebase.
The Ruff linter is configured in the ruff.toml file. You can customize it to fit your project's needs.
You can run Ruff manually:
poetry run ruff check .This project uses pre-commit to automatically run Ruff before each commit, ensuring that all code meets the specified standards.
To manually run the pre-commit hooks on all files:
poetry run pre-commit run --all-filesPoetry is a dependency management tool for Python that simplifies the process of managing dependencies, packaging, and publishing Python projects. It creates a virtual environment for the project and handles dependencies in a more organized way compared to traditional methods.
- Dependency Management: Automatically resolves and installs dependencies.
- Project Management: Provides a standard structure and format for Python projects.
- Publishing: Simplifies the process of publishing packages to PyPI.
You can find more information and detailed documentation on the Poetry website.
Feel free to contribute to this project by submitting issues or pull requests. Let's make coding more efficient and fun! 🎉