Skip to content

Commit c42a237

Browse files
committed
Fix pip installation problems
Referencing #23
1 parent 5255b69 commit c42a237

File tree

5 files changed

+69
-81
lines changed

5 files changed

+69
-81
lines changed

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
## v1.2.0 » Aug. 22, 2022
1+
## v1.2.1 » Jun. 2, 2023
22
<!-- <details>
33
<summary>Click to display changelog</summary> -->
44

5+
#### Bug Fixes
6+
* Fixed an issue where the library couldn't be installed via pip ([#23](https://github.com/Defxult/discordLevelingSystem/issues/23)).
7+
8+
<!-- </details> -->
9+
10+
## v1.2.0 » Aug. 22, 2022
11+
<details>
12+
<summary>Click to display changelog</summary>
13+
514
#### Breaking Changes
615
* 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.
716
* Function `discordLevelingSystem.version_info()` has been removed. Use `$ pip show discordLevelingSystem` instead to get the library version.
@@ -12,7 +21,7 @@
1221
#### Bug Fixes
1322
* 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)).
1423

15-
<!-- </details> -->
24+
</details>
1625

1726
## v1.1.0 » Jan. 29, 2022
1827
<details>

discordLevelingSystem/leveling_system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ async def award_xp(self, *, amount: Union[int, Sequence[int]]=[15, 25], message:
19271927
else:
19281928
amount += bonus.bonus_amount
19291929

1930-
if amount > 75:
1930+
if amount > 75: # type: ignore
19311931
amount = 75
19321932
break
19331933

pyproject.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
[project]
7+
authors = [{name = "Defxult#8269"}]
8+
name = "discordLevelingSystem"
9+
readme = "README.md"
10+
version = "1.2.1"
11+
description = "A library to implement a leveling system into a discord bot. Contains features such as XP, level, ranks, and role awards."
12+
requires-python = ">=3.8"
13+
license = {text = "MIT"}
14+
dependencies = ["discord.py>=2.0.0", "aiosqlite>=0.17.0"]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Topic :: Software Development :: Libraries",
22+
"Topic :: Software Development :: Libraries :: Python Modules"
23+
]
24+
keywords = [
25+
"database",
26+
"discord",
27+
"discord bot",
28+
"discord.py",
29+
"discord py",
30+
"discord level",
31+
"discord leveling",
32+
"discord leveling system",
33+
"level",
34+
"levels",
35+
"leveling",
36+
"level up",
37+
"level system",
38+
"mee6",
39+
"rank",
40+
"ranking",
41+
"role award",
42+
"xp"
43+
]
44+
45+
46+
[project.urls]
47+
Homepage = "https://github.com/Defxult/discordLevelingSystem"
48+
Changelog = "https://github.com/Defxult/discordLevelingSystem/blob/main/CHANGELOG.md"
49+
50+
51+
[tool.setuptools]
52+
packages = ["discordLevelingSystem"]

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
discord.py>=2.0.0
2+
aiosqlite>=0.17.0

setup.py

Lines changed: 3 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,4 @@
1-
from typing import Final, Literal
2-
from discordLevelingSystem import __source__
3-
from setuptools import setup, find_packages
1+
from setuptools import setup
42

5-
def _get_readme():
6-
with open('README.md', encoding='utf-8') as fp:
7-
return fp.read()
8-
9-
def _version_info() -> str:
10-
version = (1, 2, 0)
11-
release_level: Literal['alpha', 'beta', 'rc', 'final'] = 'final'
12-
13-
BASE: Final[str] = '.'.join([str(n) for n in version])
14-
15-
if release_level == 'final':
16-
return BASE
17-
else:
18-
# try and get the last commit hash for a more precise version, if it fails, just use the basic version
19-
try:
20-
import subprocess
21-
p = subprocess.Popen(['git', 'ls-remote', __source__, 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
22-
out, _ = p.communicate()
23-
short_hash = out.decode('utf-8')[:7]
24-
p.kill()
25-
return BASE + f"{release_level}+{short_hash}"
26-
except Exception:
27-
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.')
28-
return BASE + release_level
29-
30-
classifiers = [
31-
'Development Status :: 5 - Production/Stable',
32-
'Programming Language :: Python :: 3',
33-
'Programming Language :: Python :: 3.8',
34-
'Programming Language :: Python :: 3.9',
35-
'Programming Language :: Python :: 3.10',
36-
'Topic :: Software Development :: Libraries',
37-
'Topic :: Software Development :: Libraries :: Python Modules'
38-
]
39-
40-
tags = [
41-
'database',
42-
'discord',
43-
'discord bot',
44-
'discord.py',
45-
'discord py',
46-
'discord level',
47-
'discord leveling',
48-
'discord leveling system',
49-
'level',
50-
'levels',
51-
'leveling',
52-
'level up',
53-
'level system',
54-
'mee6',
55-
'rank',
56-
'ranking',
57-
'role award',
58-
'xp'
59-
]
60-
61-
details = {
62-
'Changelog' : 'https://github.com/Defxult/discordLevelingSystem/blob/main/CHANGELOG.md'
63-
}
64-
65-
setup(
66-
author='Defxult#8269',
67-
name='discordLevelingSystem',
68-
description='A library to implement a leveling system into a discord bot. Contains features such as XP, level, ranks, and role awards.',
69-
version=_version_info(),
70-
url='https://github.com/Defxult/discordLevelingSystem',
71-
project_urls=details,
72-
classifiers=classifiers,
73-
long_description=_get_readme(),
74-
long_description_content_type='text/markdown',
75-
license='MIT',
76-
keywords=tags,
77-
packages=find_packages(),
78-
install_requires=['aiosqlite>=0.17.0', 'discord.py>=2.0.0']
79-
)
3+
if __name__ == "__main__":
4+
setup()

0 commit comments

Comments
 (0)