diff --git a/CHANGELOG.md b/CHANGELOG.md index f78c31d..ec13065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Buildpack detection now recognises more Python-related file and directory names. ([#312](https://github.com/heroku/buildpacks-python/pull/312)) + ## [0.21.0] - 2024-12-18 ### Changed diff --git a/src/detect.rs b/src/detect.rs index d8ba626..3eaf4fc 100644 --- a/src/detect.rs +++ b/src/detect.rs @@ -7,8 +7,9 @@ use std::path::Path; /// This list is deliberately larger than just the list of supported package manager files, /// so that Python projects that are missing some of the required files still pass detection, /// allowing us to show a helpful error message during the build phase. -const KNOWN_PYTHON_PROJECT_FILES: [&str; 14] = [ +const KNOWN_PYTHON_PROJECT_FILES: [&str; 23] = [ ".python-version", + "__init__.py", "app.py", "main.py", "manage.py", @@ -19,9 +20,22 @@ const KNOWN_PYTHON_PROJECT_FILES: [&str; 14] = [ "pyproject.toml", "requirements.txt", "runtime.txt", + "server.py", "setup.cfg", "setup.py", "uv.lock", + // Commonly seen misspellings of requirements.txt. (Which occur since pip doesn't + // create/manage requirements files itself, so the filenames are manually typed.) + "requirement.txt", + "Requirements.txt", + "requirements.text", + "requirements.txt.txt", + "requirments.txt", + // Whilst virtual environments shouldn't be committed to Git (and so shouldn't + // normally be present during the build), they are often present for beginner + // Python apps that are missing all of the other Python related files above. + ".venv/", + "venv/", ]; /// Returns whether the specified project directory is that of a Python project, and so