From 5c2069af4246816c41bc999e150850e72981e3fe Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:34:39 -0500 Subject: [PATCH] chore(build): add pyproject.toml and externalize version Introduce pyproject.toml for modern packaging and test configuration, moving dependencies and dev extras into the project metadata. Replace requirements.txt and requirements-dev.txt with editable installs (CI updated to pip install -e ".[dev]", README install instructions added). Externalize the package version into src/common/version.py and update src/common/common.py to use __version__; Dockerfile now writes the version file and installs the package (pip install .) instead of editing source or using requirements files. Overall cleanup to support setuptools/pyproject-based builds and simplified dependency management. --- .github/workflows/ci.yml | 14 +----- Dockerfile | 10 +++-- README.md | 14 ++++++ pyproject.toml | 97 ++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 6 --- requirements.txt | 11 ----- src/common/common.py | 5 ++- src/common/version.py | 3 ++ 8 files changed, 127 insertions(+), 33 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt create mode 100644 src/common/version.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 513d046..a1cdaed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,7 @@ jobs: - name: Install Python Dependencies run: | python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade -r requirements.txt - python -m pip install --upgrade -r requirements-dev.txt + python -m pip install -e ".[dev]" - name: Test with pytest id: test @@ -76,16 +75,7 @@ jobs: REDDIT_USERNAME: ${{ vars.REDDIT_USERNAME }} REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} shell: bash - run: | - python -m pytest \ - -rxXs \ - --tb=native \ - --verbose \ - --color=yes \ - --cov=src \ - --junitxml=junit.xml \ - -o junit_family=legacy \ - tests + run: python -m pytest tests - name: Upload test coverage # any except canceled or skipped diff --git a/Dockerfile b/Dockerfile index b579e9d..e339529 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,11 +34,15 @@ RUN <<_SETUP #!/bin/bash set -e -# replace the version in the code -sed -i "s/version = '0.0.0'/version = '${BUILD_VERSION}'/g" src/common/common.py +# write the version to the version file +cat > src/common/version.py <