Skip to content

Commit

Permalink
Merge branch 'master' into mails-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
7mochi authored Sep 24, 2023
2 parents aa439bc + f77f201 commit 656c696
Show file tree
Hide file tree
Showing 70 changed files with 2,082 additions and 2,359 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ body:
label: Python Version
description: What version of python are you using?
options:
- 3.9.X (Default)
- 3.11.X (Default)
- 3.10.X
- 3.11.X
- 3.9.X
validations:
required: true
- type: textarea
Expand Down
4 changes: 4 additions & 0 deletions .github/docs/wiki/Breaking-changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Breaking changes

## 2023-09-21

The minimum Python version has been changed to 3.11.

## 2023-07-19

The behaviour of overall pp and accuracy has changed to encapsulate all of a user's scores rather than their top 100, in order to match Bancho's behaviour. This means a recalculation of user's stats is necessary. bancho.py has a recalculation tool which can be found in `tools/recalc.py` in order to facilitate this.
Expand Down
10 changes: 5 additions & 5 deletions .github/docs/wiki/Setting-up-(Manual).md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## installing bancho.py's requirements

```sh
# python3.9 is often not available natively,
# python3.11 is often not available natively,
# but we can rely on deadsnakes to provide it.
# https://github.com/deadsnakes/python3.9
# https://github.com/deadsnakes/python3.11
sudo add-apt-repository -y ppa:deadsnakes

# install required programs for running bancho.py
sudo apt install -y python3.9-dev python3.9-distutils \
sudo apt install -y python3.11-dev python3.11-distutils \
build-essential \
mysql-server redis-server \
nginx certbot
Expand All @@ -20,10 +20,10 @@ cd tools && ./enable_geoip_module.sh && cd ..
# install python's package manager, pip
# it's used to install python-specific dependencies
wget https://bootstrap.pypa.io/get-pip.py
python3.9 get-pip.py && rm get-pip.py
python3.11 get-pip.py && rm get-pip.py

# make sure pip and setuptools are up to date
python3.9 -m pip install -U pip setuptools pipenv
python3.11 -m pip install -U pip setuptools pipenv

# install bancho.py's python-specific dependencies
# (if you plan to work as a dev, you can use `make install-dev`)
Expand Down
2 changes: 1 addition & 1 deletion .github/docs/wiki/_Footer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/osuAkatsuki/bancho.py/master.svg)](https://results.pre-commit.ci/latest/github/osuAkatsuki/bancho.py/master)
[![Discord](https://discordapp.com/api/guilds/748687781605408908/widget.png?style=shield)](https://discord.gg/ShEQgUx)
4 changes: 4 additions & 0 deletions .github/docs/wiki/locale/de-DE/Breaking-changes-de-DE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Breaking changes

## 2023-09-21

Die minimale Python-Version wurde auf 3.11 geändert.

## 2023-07-19

Die Funktionsweise von Gesamt-PP und Genauigkeit hat sich geändert, um alle Scores eines Benutzers zu umfassen, anstatt die Top 100, um das Verhalten von Bancho zu entsprechen. Dies bedeutet, dass eine Neuberechnung der Statistiken eines Benutzers erforderlich ist. Bancho.py verfügt über ein Neuberechnungstool, das in `tools/recalc.py` zu finden ist, um dies zu erleichtern.
Expand Down
10 changes: 5 additions & 5 deletions .github/docs/wiki/locale/de-DE/Setting-up-(Manual)-de-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
## installing bancho.py's requirements

```sh
# python3.9 is often not available natively,
# python3.11 is often not available natively,
# but we can rely on deadsnakes to provide it.
# https://github.com/deadsnakes/python3.9
# https://github.com/deadsnakes/python3.11
sudo add-apt-repository -y ppa:deadsnakes

# install required programs for running bancho.py
sudo apt install -y python3.9-dev python3.9-distutils \
sudo apt install -y python3.11-dev python3.11-distutils \
build-essential \
mysql-server redis-server \
nginx certbot
Expand All @@ -22,10 +22,10 @@ cd tools && ./enable_geoip_module.sh && cd ..
# install python's package manager, pip
# it's used to install python-specific dependencies
wget https://bootstrap.pypa.io/get-pip.py
python3.9 get-pip.py && rm get-pip.py
python3.11 get-pip.py && rm get-pip.py

# make sure pip and setuptools are up to date
python3.9 -m pip install -U pip setuptools pipenv
python3.11 -m pip install -U pip setuptools pipenv

# install bancho.py's python-specific dependencies
# (if you plan to work as a dev, you can use `make install-dev`)
Expand Down
2 changes: 1 addition & 1 deletion .github/docs/wiki/locale/de-DE/_Footer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![Codestil: black](https://img.shields.io/badge/code%20stil-black-000000.svg)](https://github.com/ambv/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/osuAkatsuki/bancho.py/master.svg)](https://results.pre-commit.ci/latest/github/osuAkatsuki/bancho.py/master)
[![Discord](https://discordapp.com/api/guilds/748687781605408908/widget.png?style=shield)](https://discord.gg/ShEQgUx)
4 changes: 4 additions & 0 deletions .github/docs/wiki/locale/zh-CN/Breaking-changes-zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Breaking changes

## 2023-09-21

The minimum Python version has been changed to 3.11.

## 2023-07-19

The behaviour of overall pp and accuracy has changed to encapsulate all of a user's scores rather than their top 100, in order to match Bancho's behaviour. This means a recalculation of user's stats is necessary. bancho.py has a recalculation tool which can be found in tools/recalc.py in order to facilitate this.
Expand Down
10 changes: 5 additions & 5 deletions .github/docs/wiki/locale/zh-CN/Setting-up-(Manual)-zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## installing bancho.py's requirements

```sh
# python3.9 is often not available natively,
# python3.11 is often not available natively,
# but we can rely on deadsnakes to provide it.
# https://github.com/deadsnakes/python3.9
# https://github.com/deadsnakes/python3.11
sudo add-apt-repository -y ppa:deadsnakes

# install required programs for running bancho.py
sudo apt install -y python3.9-dev python3.9-distutils \
sudo apt install -y python3.11-dev python3.11-distutils \
build-essential \
mysql-server redis-server \
nginx certbot
Expand All @@ -20,10 +20,10 @@ cd tools && ./enable_geoip_module.sh && cd ..
# install python's package manager, pip
# it's used to install python-specific dependencies
wget https://bootstrap.pypa.io/get-pip.py
python3.9 get-pip.py && rm get-pip.py
python3.11 get-pip.py && rm get-pip.py

# make sure pip and setuptools are up to date
python3.9 -m pip install -U pip setuptools pipenv
python3.11 -m pip install -U pip setuptools pipenv

# install bancho.py's python-specific dependencies
# (if you plan to work as a dev, you can use `make install-dev`)
Expand Down
2 changes: 1 addition & 1 deletion .github/docs/wiki/locale/zh-CN/_Footer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![代码风格 black](https://img.shields.io/badge/代码风格-black-000000.svg)](https://github.com/ambv/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/osuAkatsuki/bancho.py/master.svg)](https://results.pre-commit.ci/latest/github/osuAkatsuki/bancho.py/master)
[![Discord](https://discordapp.com/api/guilds/748687781605408908/widget.png?style=shield)](https://discord.gg/ShEQgUx)
24 changes: 24 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint
on:
push:
paths:
- '*.py'

jobs:
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install pipenv
run: python -m pip install --upgrade pipenv wheel
# TODO: add caching of Pipfile.lock
- name: Install dependencies
run: pipenv install --dev --deploy
- name: Run mypy
run: pipenv run mypy .
2 changes: 1 addition & 1 deletion .github/workflows/lock-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'
- name: Install pipenv
run: python -m pip install --upgrade pipenv wheel
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
rev: v3.11.0
hooks:
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]
args: [--py311-plus, --keep-runtime-typing]
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.11.0
hooks:
Expand All @@ -35,4 +35,4 @@ repos:
- id: blacken-docs

default_language_version:
python: python3.9
python: python3.11
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ test:
lint:
pipenv run pre-commit run --all-files

type-check:
pipenv run mypy .

install:
PIPENV_VENV_IN_PROJECT=1 pipenv install

Expand All @@ -17,17 +20,14 @@ install-dev:
uninstall:
pipenv --rm

update:
update: # THIS WILL NOT RUN ON WINDOWS DUE TO UVLOOP; USE WSL
pipenv update --dev
make test
# make test ; disabled as it fails for now
pipenv requirements > requirements.txt
pipenv requirements --dev > requirements-dev.txt

clean:
pipenv clean

run:
pipenv run python main.py

run-prod:
pipenv run ./scripts/start_server.sh
9 changes: 6 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[packages]
aiohttp = "*"
aioredis = "*"
async-timeout = "*"
bcrypt = "*"
datadog = "*"
fastapi = "*"
Expand All @@ -19,17 +19,20 @@ uvicorn = "*"
uvloop = "*"
py3rijndael = "*"
pytimeparse = "*"
redis = "*"
sqlalchemy = "1.4.41"
databases = {extras = ["mysql"], version = "0.5.5"}
databases = {extras = ["mysql"], version = "*"}
akatsuki-pp-py = "*"
cryptography = "*"
tenacity = "*"

[dev-packages]
pytest = "*"
pre-commit = "*"
black = "*"
reorder-python-imports = "*"
mypy = "*"
autoflake = "*"

[requires]
python_version = "3.9"
python_version = "3.11"
Loading

0 comments on commit 656c696

Please sign in to comment.