Skip to content

Commit

Permalink
Merge pull request #2 from panpuchkov/feature/pip-package
Browse files Browse the repository at this point in the history
Feature/pip package
  • Loading branch information
panpuchkov authored Dec 28, 2023
2 parents 157b296 + 60d1c9f commit d18cc7b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pygitver"
version = "0.1.0-dev"
version = "0.1.0"
authors = [
{ name="Yurii Puchkov", email="[email protected]" },
]
Expand Down Expand Up @@ -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"]
"*" = ["*"]
2 changes: 0 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Jinja2

tox
pytest
black
Expand Down
2 changes: 1 addition & 1 deletion src/pygitver/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GitError(Exception):


class Git:
__version__ = "0.1.2"
__version__ = "0.1.0"

@staticmethod
def _cmd(command: str) -> str:
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit d18cc7b

Please sign in to comment.