Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add Python 3.12 support #79

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6db23f6
refactor: remove unused import
null8626 Mar 26, 2024
a9f6ee7
meta: update links
null8626 Mar 26, 2024
28c56e4
meta: make the min supported ver 3.8
null8626 Mar 26, 2024
957af68
fix: python 3.12 support
null8626 Mar 26, 2024
3300b50
fix: why does it say 3.1 :skull:
null8626 Mar 26, 2024
c2c7a69
fix: migrate from setup.py to pyproject.toml
null8626 Mar 26, 2024
ee2ec2e
meta: bump version
null8626 Mar 26, 2024
472f69d
ci: support pyproject.toml
null8626 Mar 26, 2024
5ee4fec
feat: add python-publish.yml again with PyPI token support
null8626 Mar 26, 2024
82187cb
meta: update .gitignore [skip ci]
null8626 Mar 26, 2024
f4e83c0
meta: change maintainers
null8626 Mar 27, 2024
533295a
doc: trauma
null8626 Mar 27, 2024
df9b489
meta: remove duplicated path in .gitignore
null8626 Mar 27, 2024
eda566e
meta: update LICENSE
null8626 Mar 27, 2024
e146048
*: use ruff, remove need for default_bot_id, deprecate get_bots, make…
null8626 Mar 28, 2024
a4ce9f2
fix: let's see if this fixes it
null8626 Mar 28, 2024
d4a9123
fix: this should fix it
null8626 Mar 28, 2024
d3b48dc
fix: AAAAAAAAAAHHHHHHH
null8626 Mar 28, 2024
e7bd0b8
fix: fix bot_id test
null8626 Mar 28, 2024
99d8ab7
refactor: collapse if-statement
null8626 Mar 28, 2024
b6be4c4
doc: update readme
null8626 Mar 28, 2024
d2ae045
doc: documentation overhaul
null8626 Mar 28, 2024
99b9bc3
doc: add examples
null8626 Mar 28, 2024
8ea8f7a
doc: more redirects and refactor js script
null8626 Mar 28, 2024
1ed5505
doc: tweaks
null8626 Mar 28, 2024
ad4386b
doc: show monthly downloads
null8626 Mar 28, 2024
dd1a277
doc: show up monthly pypi downloads
null8626 Mar 28, 2024
cd6380f
doc: use pip, not pip3
null8626 Mar 28, 2024
023d63e
meta: update project URLs
null8626 Mar 28, 2024
f80bd29
fix: shutdown web.Application on close()
null8626 Jun 6, 2024
dcfdaea
fix: initialize __app as None at initialization
null8626 Jun 6, 2024
549eb59
meta: bump aiohttp
null8626 Jun 29, 2024
47e96f5
refactor: remove unneeded non-base64 removal
null8626 Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8, 3.9 ]
null8626 marked this conversation as resolved.
Show resolved Hide resolved
python-version: [ 3.8, 3.9, '3.10', 3.11, 3.12 ]

steps:
- uses: actions/checkout@v2
Expand All @@ -29,7 +29,7 @@ jobs:
path: "requirements-dev.txt"
- name: Install itself
run: |
python setup.py install
python -m pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine -r requirements.txt
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_USERNAME: '__token__'
null8626 marked this conversation as resolved.
Show resolved Hide resolved
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
twine upload dist/*
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dblpy.egg-info/
topggpy.egg-info/
topggpy.egg-info/
topgg/__pycache__/
null8626 marked this conversation as resolved.
Show resolved Hide resolved
build/
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
image: latest

python:
version: 3.8
version: 3.12
install:
- requirements: requirements.txt
- requirements: requirements-docs.txt
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright 2021 Assanali Mukhanov & Top.gg
Copyright 2024 null & Top.gg
null8626 marked this conversation as resolved.
Show resolved Hide resolved

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
10 changes: 1 addition & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Top.gg Python Library

.. image:: https://img.shields.io/pypi/v/topggpy.svg
:target: https://pypi.python.org/pypi/topggpy
:alt: View on PyPi
:alt: View on PyPI
.. image:: https://img.shields.io/pypi/pyversions/topggpy.svg
:target: https://pypi.python.org/pypi/topggpy
:alt: v1.0.0
Expand All @@ -17,18 +17,10 @@ A simple API wrapper for `Top.gg <https://top.gg/>`_ written in Python, supporti
Installation
------------

Install via pip (recommended)

.. code:: bash

pip3 install topggpy

Install from source

.. code:: bash

pip3 install git+https://github.com/top-gg/python-sdk/

Documentation
-------------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
autodoc_member_order = "groupwise"

extlinks = {
"issue": ("https://github.com/top-gg/python-sdk/issues/%s", "GH-"),
"issue": ("https://github.com/top-gg-community/python-sdk/issues/%s", "GH-"),
}

intersphinx_mapping = {
Expand Down
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[build-system]
requires = ["setuptools"]

[project]
name = "topggpy"
version = "2.0.1"
description = "A simple API wrapper for Top.gg written in Python."
readme = "README.rst"
license = { text = "MIT" }
authors = [{ name = "null8626" }, { name = "Top.gg" }]
keywords = ["discord", "bot", "topgg", "top.gg"]
dependencies = ["aiohttp>=3.9.0"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities"
]
requires-python = ">=3.8"

[project.urls]
Homepage = "https://topggpy.readthedocs.io/en/stable/"
Documentation = "https://topggpy.readthedocs.io/en/stable/"
Repository = "https://github.com/top-gg-community/python-sdk"
2 changes: 2 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
sphinx
insegel
sphinxcontrib-napoleon
sphinx-rtd-dark-mode
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aiohttp>=3.6.0,<3.9.0
aiohttp>=3.9.0
64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_autopost.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from aiohttp import ClientSession
from pytest_mock import MockerFixture

from topgg import DBLClient, StatsWrapper
from topgg import DBLClient
from topgg.autopost import AutoPoster
from topgg.errors import ServerError, TopGGException, Unauthorized

Expand Down
6 changes: 3 additions & 3 deletions topgg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
~~~~~~~~~~~~~~~~~~~~~~~~~
A basic wrapper for the Top.gg API.
:copyright: (c) 2021 Assanali Mukhanov & Top.gg
:copyright: (c) 2024 null & Top.gg
:license: MIT, see LICENSE for more details.
"""

__title__ = "topggpy"
__author__ = "Assanali Mukhanov"
__maintainer__ = "Norizon"
__author__ = "null8626"
__license__ = "MIT"
__version__ = "2.0.0a1"
__version__ = "2.0.1"

from .autopost import *
from .client import *
Expand Down
2 changes: 1 addition & 1 deletion topgg/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
[self.global_rate_limiter, self.bot_rate_limiter]
)
self.user_agent = (
f"topggpy (https://github.com/top-gg/python-sdk {__version__}) Python/"
f"topggpy (https://github.com/top-gg-community/python-sdk {__version__}) Python/"
f"{sys.version_info[0]}.{sys.version_info[1]} aiohttp/{aiohttp.__version__}"
)

Expand Down
Empty file removed topgg/py.typed
Empty file.
Loading