Skip to content

Commit 8119b1f

Browse files
committed
refactor: reorganize project structure and update import paths to src
1 parent e84012d commit 8119b1f

File tree

17 files changed

+23
-43
lines changed

17 files changed

+23
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ cd threadfactory
5555
python -m venv .venv
5656
source .venv/bin/activate # or .venv\Scripts\activate on Windows
5757

58-
# Install the library in editable mode
58+
# Install from PyPI:
5959
pip install threadfactory

Tests/Bag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
import threading
3-
from Threading.Bag import ConcurrentBag, Empty
3+
from src.Threading import ConcurrentBag, Empty
44

55
class TestConcurrentBag(unittest.TestCase):
66

Tests/Concurrent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from Threading.Concurrent import Concurrent
2+
from src.Threading.Concurrent import Concurrent
33
import time
44

55
class TestParallel(unittest.TestCase):

Tests/Dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
import threading
3-
from Threading.Dict import ConcurrentDict
3+
from src.Threading import ConcurrentDict
44
import random
55

66
class TestConcurrentDict(unittest.TestCase):

Tests/List.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
import threading
3-
from Threading.List import ConcurrentList
3+
from src.Threading import ConcurrentList
44

55

66
class TestConcurrentList(unittest.TestCase):

Tests/Queue.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import unittest
22
import threading
33
import random
4-
import time
5-
import copy
6-
from Threading.Queue import ConcurrentQueue, Empty
4+
from src.Threading.Queue import ConcurrentQueue, Empty
75

86
class TestConcurrentQueue(unittest.TestCase):
97

@@ -91,7 +89,7 @@ def test_copy_and_deepcopy(self):
9189
"""
9290
Test copy() and deepcopy() produce correct separate objects.
9391
"""
94-
from copy import copy, deepcopy
92+
from copy import deepcopy
9593
q = ConcurrentQueue([{"x": 1}, {"y": 2}])
9694

9795
q_copy = q.copy()

Tests/Stack.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import unittest
22
import threading
33
import random
4-
import time
5-
import copy
6-
from Threading.Stack import ConcurrentStack, Empty
4+
from src.Threading import ConcurrentStack, Empty
75

86
class TestConcurrentStack(unittest.TestCase):
97

__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ def _detect_nogil_mode() -> None:
5252

5353
_detect_nogil_mode()
5454

55-
from Threading.Bag import ConcurrentBag
56-
from Threading.Dict import ConcurrentDict
57-
from Threading.List import ConcurrentList
58-
from Threading.Queue import ConcurrentQueue
59-
from Threading.Stack import ConcurrentStack
60-
from Threading.Concurrent import Concurrent
55+
from src.Threading.Bag import ConcurrentBag
56+
from src.Threading.Dict import ConcurrentDict
57+
from src.Threading.List import ConcurrentList
58+
from src.Threading.Queue import ConcurrentQueue
59+
from src.Threading.Stack import ConcurrentStack
60+
from src.Threading.Concurrent import Concurrent
6161

6262
__all__ = [
6363
"ConcurrentBag",

pyproject.toml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ThreadFactory"
7-
version = "1.0.0" # Consider syncing with __version__ later!
7+
version = "1.0.0"
88
description = "A high-performance thread-safe data structure and concurrency library for Python 3.13+ (no-GIL)."
99
readme = "README.md"
1010
requires-python = ">=3.13"
@@ -35,45 +35,30 @@ keywords = [
3535
]
3636

3737
classifiers = [
38-
# Python Versions
3938
"Programming Language :: Python :: 3",
4039
"Programming Language :: Python :: 3.13",
4140
"Programming Language :: Python :: Implementation :: CPython",
42-
43-
# License & OS
4441
"License :: OSI Approved :: MIT License",
4542
"Operating System :: OS Independent",
46-
47-
# Audience
4843
"Intended Audience :: Developers",
4944
"Intended Audience :: Science/Research",
50-
51-
# Topics
5245
"Topic :: Software Development :: Libraries :: Python Modules",
5346
"Topic :: Software Development :: Libraries",
5447
"Topic :: System :: Distributed Computing",
5548
"Topic :: System :: Networking",
5649
"Topic :: Utilities",
57-
58-
# Environment
5950
"Environment :: Console"
6051
]
6152

62-
dependencies = [] # You can leave this empty for now, or add future deps here.
63-
64-
# Optional: suggest extras if you add optional features later
65-
# [project.optional-dependencies]
66-
# dev = ["pytest", "black"]
53+
dependencies = []
6754

6855
[project.urls]
6956
Homepage = "https://github.com/Synaptic724/ThreadFactory"
7057
Repository = "https://github.com/Synaptic724/ThreadFactory"
7158
Issues = "https://github.com/Synaptic724/ThreadFactory/issues"
7259
Documentation = "https://github.com/Synaptic724/ThreadFactory#readme"
7360

74-
[tool.setuptools]
75-
packages = ["Threading"] # Explicitly define your package directory (optional)
76-
77-
# Optional: if you want to include your tests in the source distribution
78-
# [tool.setuptools.package-data]
79-
# "Threading" = ["tests/*"]
61+
[tool.setuptools.packages.find]
62+
where = ["src"]
63+
include = ["Threading"]
64+
exclude = ["Tests"]

Threading/Bag.py renamed to src/Threading/Bag.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import threading
22
from copy import deepcopy
33
import functools
4-
import warnings
5-
from Threading.Dict import ConcurrentDict
4+
from src.Threading.Dict import ConcurrentDict
65
from typing import (
76
Any,
87
Callable,

0 commit comments

Comments
 (0)