Skip to content

Commit

Permalink
Merge pull request #54 from unipoll/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
mike-pisman authored Sep 4, 2023
2 parents d45e8fc + ebf3b66 commit b134f05
Show file tree
Hide file tree
Showing 36 changed files with 396 additions and 236 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Testing with Tox
on:
workflow_dispatch:
pull_request:
push:
branches:
- "Development"
- "test_tox"
- "main"

jobs:
test:
Expand All @@ -21,13 +19,26 @@ jobs:
node-version: [18.x]
mongodb-version: ['6.0']
steps:
- name: Force Install GIT latest
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install -y git
echo "GIT Version: $(git --version)"
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: ${{ matrix.mongodb-version }}

Expand All @@ -45,15 +56,8 @@ jobs:
run: |
tox run
# - name: Delete MongoDB
# run: |
# docker stop mongodb
# docker rm mongodb
# docker system prune -f

# - name: 'Cleanup build folder'
# run: |
# ls -la ./
# rm -rf ./* || true
# rm -rf ./.??* || true
# ls -la ./
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ dmypy.json

# vscode history
.history/
.vscode/settings.json
.vscode/settings.json
coverage.lcov
54 changes: 25 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "build"]
requires = ["setuptools", "setuptools-scm[toml]>=7.1", "build"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# write_to = "app/_version.py"
# version_scheme = "python-simplified-semver"

# [tool.setuptools.dynamic]
# version = {file = "version.txt"}


[tool.semantic_release]
version_source = "tag_only"
branch = "main"
major_on_zero = true
upload_to_pypi = false
# upload_to_repository = true
upload_to_release = true
commit_version_number = true
tag_commit = true

changelog_file = "CHANGELOG.md"
build_command = "python -m build ."
# commit_message = "chore(release): v{version} [skip ci]"


[project]
name = "unipoll-api"
dynamic= ["version"]
description = "My package description"
description = "Unipoll API"
authors = [{email = "mpisman@unipol.cc"}, {name = "Michael Pisman"}]
readme = "README.md"
requires-python = ">=3.11"
Expand Down Expand Up @@ -56,20 +33,39 @@ testings = [
]

[optional.package_data]
polling_app_server = [
unipoll-api = [
"py.typed",
]

[tool.setuptools_scm]
# version_scheme = "python-simplified-semver"


[tool.semantic_release]
version_source = "tag_only"
branch = "main"
major_on_zero = true
upload_to_pypi = false
# upload_to_repository = true
upload_to_release = true
commit_version_number = true
tag_commit = true

changelog_file = "CHANGELOG.md"
build_command = "python -m build ."
# commit_message = "chore(release): v{version} [skip ci]"

[tool.flake8]
max-line-length = 120

[tool.pytest.ini_options]
addopts = "--cov=polling_app_server"
addopts = "--cov --cov-report lcov"
testpaths = ["tests"]
asyncio_mode="auto"
filterwarnings = [
"ignore:'cgi' is deprecated:DeprecationWarning",
'ignore:cgi is deprecated:DeprecationWarning',
"ignore:'crypt' is deprecated:DeprecationWarning",
'ignore:pkg_resources is deprecated:DeprecationWarning',
"ignore::pytest.PytestCollectionWarning"
]

Expand All @@ -88,4 +84,4 @@ warn_unreachable = true
no_implicit_reexport = true
plugins = [
"pydantic.mypy"
]
]
9 changes: 0 additions & 9 deletions pytest.ini

This file was deleted.

19 changes: 16 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
annotated-types==0.5.0
anyio==3.6.2
asgi-lifespan==2.1.0
asttokens==2.2.1
async-generator==1.10
asyncio==3.4.3
attrs==23.1.0
Expand All @@ -16,9 +18,11 @@ click==8.1.3
colorama==0.4.6
coverage==7.2.5
cryptography==40.0.2
devtools==0.12.1
distlib==0.3.6
dnspython==2.3.0
email-validator==2.0.0.post2
executing==1.2.0
Faker==18.7.0
fastapi==0.98.0
fastapi-users==11.0.0
Expand All @@ -34,12 +38,15 @@ iniconfig==2.0.0
itsdangerous==2.1.2
Jinja2==3.1.2
lazy-model==0.0.5
libcst==1.0.1
makefun==1.15.1
markdown-it-py==3.0.0
MarkupSafe==2.1.2
mccabe==0.7.0
mdurl==0.1.2
motor==3.1.2
multidict==6.0.4
mypy==1.4.0
mypy==1.5.1
mypy-extensions==1.0.0
orjson==3.8.12
outcome==1.2.0
Expand All @@ -49,8 +56,10 @@ platformdirs==3.5.1
pluggy==1.0.0
pycodestyle==2.10.0
pycparser==2.21
pydantic==1.10.7
pydantic==1.10.9
pydantic_core==2.6.3
pyflakes==3.0.1
Pygments==2.16.1
PyJWT==2.6.0
pymongo==4.3.3
pyproject_api==1.5.1
Expand All @@ -64,6 +73,8 @@ python-dotenv==1.0.0
python-multipart==0.0.6
PyYAML==6.0
requests==2.30.0
rich==13.5.2
setuptools-scm==7.1.0
six==1.16.0
sniffio==1.3.0
sortedcontainers==2.4.0
Expand All @@ -73,6 +84,7 @@ toml==0.10.2
tox==4.5.1
tox-gh-actions==3.1.0
trio==0.22.0
typer==0.9.0
types-colorama==0.4.15.11
types-cryptography==3.3.23.2
types-docutils==0.20.0.1
Expand All @@ -84,7 +96,8 @@ types-requests==2.31.0.1
types-setuptools==68.0.0.0
types-ujson==5.8.0.0
types-urllib3==1.26.25.13
typing_extensions==4.5.0
typing-inspect==0.9.0
typing_extensions==4.7.1
ujson==5.7.0
urllib3==2.0.2
uvicorn==0.22.0
Expand Down
2 changes: 1 addition & 1 deletion src/account_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from src.utils.token_db import BeanieAccessTokenDatabase
# from fastapi_users.authentication.strategy.db import AccessTokenDatabase, DatabaseStrategy
from src.utils.auth_strategy import DatabaseStrategy
from src.models.documents import Account, AccessToken
from src.documents import Account, AccessToken
from src.utils import colored_dbg


Expand Down
2 changes: 1 addition & 1 deletion src/actions/account.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Account actions
from src.models import documents as Documents
from src import documents as Documents
from src.account_manager import current_active_user
from src.exceptions import account as AccountExceptions

Expand Down
2 changes: 1 addition & 1 deletion src/actions/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from fastapi import Depends

from src.models.documents import Account
from src.documents import Account
from src.exceptions import authentication as AuthExceptions
from src.exceptions import account as AccountExceptions
from src.utils import colored_dbg as Debug
Expand Down
Loading

0 comments on commit b134f05

Please sign in to comment.