Skip to content

Commit

Permalink
Merge pull request #30 from medaka0213/poetry
Browse files Browse the repository at this point in the history
Poetryに移行
  • Loading branch information
medaka0213 authored Apr 7, 2024
2 parents d17cafa + 6f47cba commit bb993ef
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 135 deletions.
96 changes: 0 additions & 96 deletions .github/workflows/deploy.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.12"

- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install poetry
poetry install
- name: Run flake8 linter
run: |
flake8 ddb_single --max-line-length=120
flake8 tests --max-line-length=120
flake8 setup.py --max-line-length=120
poetry run flake8 .
- name: Run unittest
run: |
coverage run -m unittest discover -s tests/
coverage report
poetry run pytest --cov=ddb_single -v
- name: Test Build
run: |
poetry build
92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release
on:
workflow_dispatch:
inputs:
rule:
description: "Rule to run"
required: false
default: patch
type: choice
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease

jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install dependencies
run: |
pip install poetry
- name: Get changelog
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GH_TOKEN }}
dry_run: true

- name: Update version
run: |
poetry version ${{ github.event.inputs.rule }}
version=$(poetry version -s)
echo "VERSION=$version" >> $GITHUB_ENV
- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "[skip ci] Update version to ${{ env.VERSION }}"
git push
- name: Create and push tag
run: |
git tag v${{ env.VERSION }}
git push origin v${{ env.VERSION }}
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
draft: false
prerelease: false
body: ${{ steps.tag_version.outputs.changelog }}

- name: Publish package
env:
PYPI_LOCAL_USERNAME: __token__
PYPI_LOCAL_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build
poetry publish -u $PYPI_LOCAL_USERNAME -p $PYPI_LOCAL_PASSWORD
- name: Generate docs
run: |
cp ./readme.md ./docs_src/readme.md
poetry run sphinx-apidoc -f -o ./docs_src ./ddb_single
poetry run sphinx-build ./docs_src ./docs
- name: Publish github pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./docs
clean: true
commit-message: Deploy as of ${{ github.sha }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ build
dist
shared-local-instance.db
.coverage
docs
docs
poetry.lock
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

[tool.poetry]
name = "ddb_single"
version = "0.4.7"
description = "Python DynamoDB interface, specialized in single-table design."
authors = ["medaka <[email protected]>"]
license = "MIT"
homepage = "https://medaka0213.github.io/DynamoDB-SingleTable/"
repository = "https://github.com/medaka0213/DynamoDB-SingleTable"
keywords = ["aws", "dynamodb", "serverless"]
packages = [{ include = "ddb_single" }]

[tool.poetry.dependencies]
python = "^3.10"
boto3 = "^1.34.79"

[tool.poetry.dev-dependencies]

[tool.poetry.group.dev.dependencies]
sphinx = "^7.2.6"
sphinx-rtd-theme = "^2.0.0"
pyproject-flake8 = "^6.1.0"
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ It makes effective and easy to manage your whole data models for single service.
pip install ddb-single
```

### Start DynamoDB Local

```
docker run -d --rm -p 8000:8000 amazon/dynamodb-local
```

### Init Table

```python
Expand Down
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

28 changes: 0 additions & 28 deletions setup.py

This file was deleted.

0 comments on commit bb993ef

Please sign in to comment.