Skip to content

Commit 85dfcd9

Browse files
committed
hatch as a dependency
1 parent fb504ee commit 85dfcd9

5 files changed

Lines changed: 42 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[project]
22
name = "python-usernames"
3-
version = "1.0.0"
43
description = "Python library to validate usernames suitable for use in public facing applications."
54
authors = [
65
{ name = "Saurabh Kumar", email = "python-usernames@saurabh-kumar.com" }
@@ -61,7 +60,11 @@ dev-dependencies = [
6160
"pytest~=7.3.2",
6261
"black~=23.3.0",
6362
"ruff~=0.0.272",
63+
"hatch~=1.7.0",
6464
]
6565

6666
[tool.hatch.metadata]
6767
allow-direct-references = true
68+
69+
[tool.hatch.version]
70+
path = "src/python_usernames/__about__.py"

requirements-dev.lock

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,44 @@
77
# all-features: false
88

99
-e file:.
10+
anyio==3.7.0
1011
black==23.3.0
12+
certifi==2023.5.7
1113
click==8.1.3
14+
distlib==0.3.6
15+
editables==0.3
16+
filelock==3.12.2
17+
h11==0.14.0
18+
hatch==1.7.0
19+
hatchling==1.18.0
20+
httpcore==0.17.2
21+
httpx==0.24.1
22+
hyperlink==21.0.0
23+
idna==3.4
24+
importlib-metadata==6.6.0
1225
iniconfig==2.0.0
26+
jaraco-classes==3.2.3
27+
keyring==23.13.1
28+
markdown-it-py==3.0.0
29+
mdurl==0.1.2
30+
more-itertools==9.1.0
1331
mypy-extensions==1.0.0
1432
packaging==23.1
1533
pathspec==0.11.1
34+
pexpect==4.8.0
1635
platformdirs==3.5.3
1736
pluggy==1.0.0
37+
ptyprocess==0.7.0
38+
pygments==2.15.1
39+
pyperclip==1.8.2
1840
pytest==7.3.2
41+
rich==13.4.2
1942
ruff==0.0.272
43+
shellingham==1.5.0.post1
44+
sniffio==1.3.0
45+
tomli-w==1.0.0
46+
tomlkit==0.11.8
47+
trove-classifiers==2023.5.24
48+
userpath==1.8.0
49+
virtualenv==20.23.1
50+
zipp==3.15.0

src/python_usernames/__about__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VERSION = "0.4.1"

src/python_usernames/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from .validators import is_safe_username
22

3+
__version__ = "0.4.1"
4+
35
__all__ = ["is_safe_username"]

src/python_usernames/reserved_words.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
# Try backported to PY<37 `importlib_resources`.
1616
import importlib_resources as pkg_resources
1717

18+
1819
def get_reserved_words():
19-
content = ''
20+
content = ""
2021
# https://stackoverflow.com/questions/6028000/
2122
try:
2223
with (pkg_resources.files("python_usernames") / "words.txt").open() as _f:
2324
content = _f.read()
2425
except AttributeError:
2526
# Python < PY3.9, fall back to method deprecated in PY3.11.
26-
content = pkg_resources.read_text("python_usernames", 'words.txt')
27+
content = pkg_resources.read_text("python_usernames", "words.txt")
2728

2829
return set(content.splitlines())
2930

31+
3032
__all__ = ["get_reserved_words"]

0 commit comments

Comments
 (0)