Skip to content

Commit

Permalink
Fix pip installation problems
Browse files Browse the repository at this point in the history
Referencing #23
  • Loading branch information
Defxult committed Jun 2, 2023
1 parent 5255b69 commit c42a237
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 81 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
## v1.2.0 » Aug. 22, 2022
## v1.2.1 » Jun. 2, 2023
<!-- <details>
<summary>Click to display changelog</summary> -->

#### Bug Fixes
* Fixed an issue where the library couldn't be installed via pip ([#23](https://github.com/Defxult/discordLevelingSystem/issues/23)).

<!-- </details> -->

## v1.2.0 » Aug. 22, 2022
<details>
<summary>Click to display changelog</summary>

#### Breaking Changes
* The developer of discord.py has decided to revive the project. Since this library was originally dependent on discord.py, as of this version it is no longer dependent on pycord and will be using discord.py 2.0 or higher for the duration of this library.
* Function `discordLevelingSystem.version_info()` has been removed. Use `$ pip show discordLevelingSystem` instead to get the library version.
Expand All @@ -12,7 +21,7 @@
#### Bug Fixes
* Fixed an issue where an error would occur when a user/guild doesn't have an icon. Now, the icon is the default discord user icon ([#5](https://github.com/Defxult/discordLevelingSystem/issues/15)).

<!-- </details> -->
</details>

## v1.1.0 » Jan. 29, 2022
<details>
Expand Down
2 changes: 1 addition & 1 deletion discordLevelingSystem/leveling_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ async def award_xp(self, *, amount: Union[int, Sequence[int]]=[15, 25], message:
else:
amount += bonus.bonus_amount

if amount > 75:
if amount > 75: # type: ignore
amount = 75
break

Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"


[project]
authors = [{name = "Defxult#8269"}]
name = "discordLevelingSystem"
readme = "README.md"
version = "1.2.1"
description = "A library to implement a leveling system into a discord bot. Contains features such as XP, level, ranks, and role awards."
requires-python = ">=3.8"
license = {text = "MIT"}
dependencies = ["discord.py>=2.0.0", "aiosqlite>=0.17.0"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules"
]
keywords = [
"database",
"discord",
"discord bot",
"discord.py",
"discord py",
"discord level",
"discord leveling",
"discord leveling system",
"level",
"levels",
"leveling",
"level up",
"level system",
"mee6",
"rank",
"ranking",
"role award",
"xp"
]


[project.urls]
Homepage = "https://github.com/Defxult/discordLevelingSystem"
Changelog = "https://github.com/Defxult/discordLevelingSystem/blob/main/CHANGELOG.md"


[tool.setuptools]
packages = ["discordLevelingSystem"]
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
discord.py>=2.0.0
aiosqlite>=0.17.0
81 changes: 3 additions & 78 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,79 +1,4 @@
from typing import Final, Literal
from discordLevelingSystem import __source__
from setuptools import setup, find_packages
from setuptools import setup

def _get_readme():
with open('README.md', encoding='utf-8') as fp:
return fp.read()

def _version_info() -> str:
version = (1, 2, 0)
release_level: Literal['alpha', 'beta', 'rc', 'final'] = 'final'

BASE: Final[str] = '.'.join([str(n) for n in version])

if release_level == 'final':
return BASE
else:
# try and get the last commit hash for a more precise version, if it fails, just use the basic version
try:
import subprocess
p = subprocess.Popen(['git', 'ls-remote', __source__, 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, _ = p.communicate()
short_hash = out.decode('utf-8')[:7]
p.kill()
return BASE + f"{release_level}+{short_hash}"
except Exception:
print('discordLevelingSystem notification: An error occurred when attempting to get the last commit ID of the repo for a more precise version of the library. Returning base development version instead.')
return BASE + release_level

classifiers = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'
]

tags = [
'database',
'discord',
'discord bot',
'discord.py',
'discord py',
'discord level',
'discord leveling',
'discord leveling system',
'level',
'levels',
'leveling',
'level up',
'level system',
'mee6',
'rank',
'ranking',
'role award',
'xp'
]

details = {
'Changelog' : 'https://github.com/Defxult/discordLevelingSystem/blob/main/CHANGELOG.md'
}

setup(
author='Defxult#8269',
name='discordLevelingSystem',
description='A library to implement a leveling system into a discord bot. Contains features such as XP, level, ranks, and role awards.',
version=_version_info(),
url='https://github.com/Defxult/discordLevelingSystem',
project_urls=details,
classifiers=classifiers,
long_description=_get_readme(),
long_description_content_type='text/markdown',
license='MIT',
keywords=tags,
packages=find_packages(),
install_requires=['aiosqlite>=0.17.0', 'discord.py>=2.0.0']
)
if __name__ == "__main__":
setup()

0 comments on commit c42a237

Please sign in to comment.