Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueRou committed Sep 24, 2023
2 parents 615f2ae + f77f201 commit 04d4602
Show file tree
Hide file tree
Showing 65 changed files with 1,278 additions and 1,584 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 .
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ repos:
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v3.11.0
hooks:
- id: pyupgrade
args: [--py311-plus, --keep-runtime-typing]
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.10.0
rev: v3.11.0
hooks:
- id: reorder-python-imports
args: [--py37-plus, --add-import, 'from __future__ import annotations']
Expand Down
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
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name = "pypi"

[packages]
aiohttp = "*"
async-timeout = "*"
bcrypt = "*"
datadog = "*"
fastapi = "*"
Expand All @@ -23,13 +24,15 @@ sqlalchemy = "1.4.41"
databases = {extras = ["mysql"], version = "*"}
akatsuki-pp-py = "*"
cryptography = "*"
tenacity = "*"

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

[requires]
python_version = "3.11"
24 changes: 21 additions & 3 deletions Pipfile.lock

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

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bancho.py

[![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)
Expand All @@ -12,7 +12,6 @@ the project is developed primarily by the [Akatsuki](https://akatsuki.gg/) team,
and our aim is to create the most easily maintainable, reliable, and feature-rich
osu! server implementation available.


If you are interested in running or contributing to **bancho.py**, you should head over to the **[bancho.py wiki](https://github.com/osuAkatsuki/bancho.py/wiki)**.

## License
Expand Down
Loading

0 comments on commit 04d4602

Please sign in to comment.