Skip to content

Commit

Permalink
Update python to 3.10 (#68)
Browse files Browse the repository at this point in the history
Also update dependencies
  • Loading branch information
BlackYps authored Jun 23, 2024
1 parent 163a4eb commit 88a65fe
Show file tree
Hide file tree
Showing 21 changed files with 317 additions and 318 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install dependencies
run: |
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install dependencies
run: pip install isort
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
MYSQL_PASSWORD: banana

faf-rabbitmq:
image: rabbitmq:3.8-management-alpine
image: rabbitmq:3.9-alpine
ports:
- 5672:5672
options: >-
Expand All @@ -65,9 +65,9 @@ jobs:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Setup RabbitMQ
run: ./.github/workflows/scripts/init-rabbitmq.sh
Expand All @@ -84,8 +84,9 @@ jobs:
run: pipenv run tests --cov-report=xml

- name: Report coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

# Need git for installing aiomysql
RUN apt-get update
Expand Down
9 changes: 4 additions & 5 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,24 @@ verify_ssl = true

[packages]
trueskill = "*"
sqlalchemy = "==1.4.*"
sqlalchemy = "*"
aiomysql = "*"
aio_pika = "*"
aiocron = "*"
prometheus_client = "*"
yoyo-migrations = "*"
pamqp = "==2.3.0"
pamqp = "*"
python-dateutil = "*"

[dev-packages]
pytest = "*"
pytest-asyncio = "==0.12.0"
pytest-asyncio = "*"
pytest-cov = "*"
asynctest = "*"
python-coveralls = "*"
mock = "*"
pytest-mock = "*"
vulture = "*"
freezegun = "*"

[requires]
python_version = "3.9"
python_version = "3.10"
158 changes: 81 additions & 77 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
asyncio_mode = auto
2 changes: 1 addition & 1 deletion scripts/local_rabbitmq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RABBITMQ_LEAGUE_SERVICE_USER=faf-league-service
RABBITMQ_LEAGUE_SERVICE_PASS=banana
RABBITMQ_LEAGUE_SERVICE_VHOST=/faf-lobby

docker run -d -p 5672:5672 --restart unless-stopped --name faf-rabbitmq rabbitmq:3.8-management-alpine
docker run -d -p 5672:5672 --restart unless-stopped --name faf-rabbitmq rabbitmq:3.9-alpine

# This doesn't seem to pick up the pid file
docker exec faf-rabbitmq rabbitmqctl wait --timeout ${MAX_WAIT_SECONDS} "${RABBITMQ_PID_FILE}"
Expand Down
4 changes: 1 addition & 3 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ def signal_handler(sig: int, _frame):
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGINT, signal_handler)

database = db.FAFDatabase(loop)
await database.connect(
database = db.FAFDatabase(
host=config.DB_SERVER,
port=int(config.DB_PORT),
user=config.DB_LOGIN,
password=config.DB_PASSWORD,
maxsize=10,
db=config.DB_NAME,
)
logger.info("Database connected.")
Expand Down
Loading

0 comments on commit 88a65fe

Please sign in to comment.