From 848e7f059ff96795b78176b7e7d62c6c9362ac3d Mon Sep 17 00:00:00 2001 From: Artem Litvinov Date: Sat, 16 Sep 2023 10:24:53 +0100 Subject: [PATCH] Renamed Folder & Minor changes --- .github/workflows/assign-pr-author.yaml | 2 +- .github/workflows/check-pr.yaml | 19 ---- .github/workflows/publish-changes.yaml | 93 ------------------- .gitignore | 2 + .../.lintstagedrc.json | 0 src/{example => fastapi_example}/Makefile | 0 src/{example => fastapi_example}/README.md | 0 .../backend/__init__.py | 0 .../backend/main.py | 0 .../backend/user/__init__.py | 0 .../backend/user/handlers.py | 0 .../backend/user/models.py | 0 .../backend/user/repositories.py | 0 .../backend/user/services.py | 0 .../backend/utils/__init__.py | 0 .../backend/utils/http.py | 0 src/{example => fastapi_example}/poetry.lock | 0 src/{example => fastapi_example}/poetry.toml | 0 .../pyproject.toml | 4 +- .../tests/__init__.py | 0 20 files changed, 5 insertions(+), 115 deletions(-) delete mode 100644 .github/workflows/publish-changes.yaml rename src/{example => fastapi_example}/.lintstagedrc.json (100%) rename src/{example => fastapi_example}/Makefile (100%) rename src/{example => fastapi_example}/README.md (100%) rename src/{example => fastapi_example}/backend/__init__.py (100%) rename src/{example => fastapi_example}/backend/main.py (100%) rename src/{example => fastapi_example}/backend/user/__init__.py (100%) rename src/{example => fastapi_example}/backend/user/handlers.py (100%) rename src/{example => fastapi_example}/backend/user/models.py (100%) rename src/{example => fastapi_example}/backend/user/repositories.py (100%) rename src/{example => fastapi_example}/backend/user/services.py (100%) rename src/{example => fastapi_example}/backend/utils/__init__.py (100%) rename src/{example => fastapi_example}/backend/utils/http.py (100%) rename src/{example => fastapi_example}/poetry.lock (100%) rename src/{example => fastapi_example}/poetry.toml (100%) rename src/{example => fastapi_example}/pyproject.toml (95%) rename src/{example => fastapi_example}/tests/__init__.py (100%) diff --git a/.github/workflows/assign-pr-author.yaml b/.github/workflows/assign-pr-author.yaml index 3179974..56f734d 100644 --- a/.github/workflows/assign-pr-author.yaml +++ b/.github/workflows/assign-pr-author.yaml @@ -9,4 +9,4 @@ jobs: - uses: samspills/assign-pr-to-author@v1.0 if: github.event_name == 'pull_request' && github.event.action == 'opened' with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" + repo-token: "${{ secrets.PR_GITHUB_TOKEN }}" diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml index 7745cb0..aa377ee 100644 --- a/.github/workflows/check-pr.yaml +++ b/.github/workflows/check-pr.yaml @@ -29,12 +29,6 @@ jobs: permissions: contents: read - container: - image: ghcr.io/yp-middle-python-24/ubuntu-ci:jammy-0.0.1 - credentials: - username: ${{ secrets.ROBOT_GITHUB_USER }} - password: ${{ secrets.ROBOT_GITHUB_READ_PACKAGES_TOKEN }} - steps: - name: Checkout repository uses: actions/checkout@v3 @@ -65,23 +59,10 @@ jobs: permissions: contents: read - container: - image: ghcr.io/yp-middle-python-24/ubuntu-ci:jammy-0.0.1 - credentials: - username: ${{ secrets.ROBOT_GITHUB_USER }} - password: ${{ secrets.ROBOT_GITHUB_READ_PACKAGES_TOKEN }} - steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Login to pypi - working-directory: src/${{ matrix.package }} - env: - PYPI_READER_PASSWORD: ${{ secrets.PYPI_READER_PASSWORD }} - run: | - make ci-login-pypi - - name: Install repository dependencies run: | make ci-init diff --git a/.github/workflows/publish-changes.yaml b/.github/workflows/publish-changes.yaml deleted file mode 100644 index 43e033a..0000000 --- a/.github/workflows/publish-changes.yaml +++ /dev/null @@ -1,93 +0,0 @@ -name: Publish changed packages - -on: - push: - branches: - - master - -jobs: - generate-matrix: - name: Generate job matrices - runs-on: ubuntu-20.04 - - outputs: - packages-matrix: ${{ steps.packages-matrix.outputs.matrix }} - - steps: - - name: Generate packages matrix - id: packages-matrix - uses: hellofresh/action-changed-files@v2 - with: - pattern: src/(?P[^/]+)/ - - publish-package: - name: Publish package - runs-on: ubuntu-20.04 - needs: [generate-matrix] - if: ${{ fromJson(needs.generate-matrix.outputs.packages-matrix).include[0] }} - - strategy: - matrix: - package: ${{ fromJson(needs.generate-matrix.outputs.packages-matrix).include[*].package }} - fail-fast: false - - permissions: - contents: read - - container: - image: ghcr.io/yp-middle-python-24/ubuntu-ci:jammy-0.0.1 - credentials: - username: ${{ secrets.ROBOT_GITHUB_USER }} - password: ${{ secrets.ROBOT_GITHUB_READ_PACKAGES_TOKEN }} - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Check version - id: check_version - working-directory: src/${{ matrix.package }} - run: | - local_version=$(poetry version --short) - remote_version=$( \ - curl https://pypi.ovsds.ru/pypi/${{ matrix.package }}/json \ - --user "reader:${{ secrets.PYPI_READER_PASSWORD }}" | \ - jq -r '.info.version' || \ - echo "0.0.0" \ - ) - echo "local_version=$local_version" >> $GITHUB_OUTPUT - echo "remote_version=$remote_version" >> $GITHUB_OUTPUT - - - name: Login to pypi - if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version - working-directory: src/${{ matrix.package }} - env: - PYPI_READER_PASSWORD: ${{ secrets.PYPI_READER_PASSWORD }} - run: | - make ci-login-pypi - - - name: Init Package - if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version - working-directory: src/${{ matrix.package }} - run: | - make init - - - name: Login to pypi-publish - if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version - working-directory: src/${{ matrix.package }} - env: - PYPI_WRITER_PASSWORD: ${{ secrets.PYPI_WRITER_PASSWORD }} - run: | - make ci-login-pypi-publish - - - name: Build Package - if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version - working-directory: src/${{ matrix.package }} - run: | - make ci-package-build - - - name: Publish Package - if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version - working-directory: src/${{ matrix.package }} - run: | - make ci-package-publish diff --git a/.gitignore b/.gitignore index 9a95741..e0d4721 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ __pycache__/ # Dists dist/ + +.env \ No newline at end of file diff --git a/src/example/.lintstagedrc.json b/src/fastapi_example/.lintstagedrc.json similarity index 100% rename from src/example/.lintstagedrc.json rename to src/fastapi_example/.lintstagedrc.json diff --git a/src/example/Makefile b/src/fastapi_example/Makefile similarity index 100% rename from src/example/Makefile rename to src/fastapi_example/Makefile diff --git a/src/example/README.md b/src/fastapi_example/README.md similarity index 100% rename from src/example/README.md rename to src/fastapi_example/README.md diff --git a/src/example/backend/__init__.py b/src/fastapi_example/backend/__init__.py similarity index 100% rename from src/example/backend/__init__.py rename to src/fastapi_example/backend/__init__.py diff --git a/src/example/backend/main.py b/src/fastapi_example/backend/main.py similarity index 100% rename from src/example/backend/main.py rename to src/fastapi_example/backend/main.py diff --git a/src/example/backend/user/__init__.py b/src/fastapi_example/backend/user/__init__.py similarity index 100% rename from src/example/backend/user/__init__.py rename to src/fastapi_example/backend/user/__init__.py diff --git a/src/example/backend/user/handlers.py b/src/fastapi_example/backend/user/handlers.py similarity index 100% rename from src/example/backend/user/handlers.py rename to src/fastapi_example/backend/user/handlers.py diff --git a/src/example/backend/user/models.py b/src/fastapi_example/backend/user/models.py similarity index 100% rename from src/example/backend/user/models.py rename to src/fastapi_example/backend/user/models.py diff --git a/src/example/backend/user/repositories.py b/src/fastapi_example/backend/user/repositories.py similarity index 100% rename from src/example/backend/user/repositories.py rename to src/fastapi_example/backend/user/repositories.py diff --git a/src/example/backend/user/services.py b/src/fastapi_example/backend/user/services.py similarity index 100% rename from src/example/backend/user/services.py rename to src/fastapi_example/backend/user/services.py diff --git a/src/example/backend/utils/__init__.py b/src/fastapi_example/backend/utils/__init__.py similarity index 100% rename from src/example/backend/utils/__init__.py rename to src/fastapi_example/backend/utils/__init__.py diff --git a/src/example/backend/utils/http.py b/src/fastapi_example/backend/utils/http.py similarity index 100% rename from src/example/backend/utils/http.py rename to src/fastapi_example/backend/utils/http.py diff --git a/src/example/poetry.lock b/src/fastapi_example/poetry.lock similarity index 100% rename from src/example/poetry.lock rename to src/fastapi_example/poetry.lock diff --git a/src/example/poetry.toml b/src/fastapi_example/poetry.toml similarity index 100% rename from src/example/poetry.toml rename to src/fastapi_example/poetry.toml diff --git a/src/example/pyproject.toml b/src/fastapi_example/pyproject.toml similarity index 95% rename from src/example/pyproject.toml rename to src/fastapi_example/pyproject.toml index 15b8ae4..b0e7c2f 100644 --- a/src/example/pyproject.toml +++ b/src/fastapi_example/pyproject.toml @@ -13,8 +13,8 @@ profile = "black" [tool.poetry] authors = ["name "] -description = "[]" -name = "example" +description = "FastAPI Template Project using DDD" +name = "FastAPI Exmaple" version = "0.1.0" [tool.poetry.dependencies] diff --git a/src/example/tests/__init__.py b/src/fastapi_example/tests/__init__.py similarity index 100% rename from src/example/tests/__init__.py rename to src/fastapi_example/tests/__init__.py