diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7ca7f0c..6465710 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,11 +28,10 @@ jobs: fetch-depth: 0 - name: Dockerfile lint - if: ${{ env.IMAGE_EXIST == 'false' }} id: validate-dockerfile shell: bash run: | - docker run --rm -e HADOLINT_IGNORE=DL3007,DL3008,DL3018,DL4006,DL3013 -i hadolint/hadolint < Dockerfile + docker run --rm -e HADOLINT_IGNORE=DL3018,DL3013 -i hadolint/hadolint < Dockerfile - name: Unit Tests shell: bash @@ -100,8 +99,8 @@ jobs: shell: bash run: | set -x + sudo apt-get -y install twine pip install -r requirements-build.txt python -m build - sudo apt-get -y install twine twine check dist/* twine upload --skip-existing -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/* --verbose diff --git a/Dockerfile b/Dockerfile index 83e8932..fa55a6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,13 +11,11 @@ WORKDIR /build-pkg COPY . /build-pkg RUN apk add --no-cache git \ - && pip install --no-cache-dir -U pip \ - && pip install --no-cache-dir -r requirements.txt \ - && pip install --no-cache-dir -r requirements-build.txt \ + && pip install --no-cache-dir -U pip -r requirements-build.txt \ && rm -rf dist \ && python -m build \ - && pip install $(ls /build-pkg/dist/pygitver-*.tar.gz) \ - && pip uninstall -r requirements-build.txt -y + && pip uninstall -r requirements-build.txt -y \ + && pip install --no-cache-dir "$(ls /build-pkg/dist/pygitver-*.tar.gz)" ################################################################ FROM python:3.12-alpine @@ -31,7 +29,7 @@ RUN apk add --no-cache git openssh # Copy application code and COPY ./src/pygitver/templates /pygitver/templates -COPY ./scripts /pygitver/scripts +COPY ./src/pygitver/scripts /pygitver/scripts COPY --from=build /opt/venv /opt/venv WORKDIR /app diff --git a/pyproject.toml b/pyproject.toml index 04e9b65..721830c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pygitver" -version = "0.1.0-dev" +version = "0.1.0" authors = [ { name="Yurii Puchkov", email="panpuchkov@gmail.com" }, ] @@ -34,5 +34,8 @@ pygitver = "pygitver.pygitver:main" url = "https://github.com/panpuchkov/pygitver" +[tool.setuptools.packages.find] +where = ["src"] + [tool.setuptools.package-data] -pygitver = ["*.py", "*.tmpl"] +"*" = ["*"] diff --git a/requirements-dev.txt b/requirements-dev.txt index abc5b38..869b660 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,3 @@ -Jinja2 - tox pytest black diff --git a/src/pygitver/git.py b/src/pygitver/git.py index 40fc0e3..4f96225 100644 --- a/src/pygitver/git.py +++ b/src/pygitver/git.py @@ -23,7 +23,7 @@ class GitError(Exception): class Git: - __version__ = "0.1.2" + __version__ = "0.1.0" @staticmethod def _cmd(command: str) -> str: diff --git a/scripts/git/hooks/commit-msg b/src/pygitver/scripts/git/hooks/commit-msg similarity index 100% rename from scripts/git/hooks/commit-msg rename to src/pygitver/scripts/git/hooks/commit-msg diff --git a/scripts/install.sh b/src/pygitver/scripts/install.sh similarity index 100% rename from scripts/install.sh rename to src/pygitver/scripts/install.sh