Skip to content

Commit 8a95b01

Browse files
Merge pull request #19 from caffeine-addictt/dev
v0.1.3
2 parents e176e27 + e437d49 commit 8a95b01

18 files changed

+284
-134
lines changed

.coverage

0 Bytes
Binary file not shown.

.github/workflows/test-worker.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install -U pip
26-
python -m pip install -U coverage pytest pytest-cov
26+
python -m pip install -U coverage pytest pytest-cov poetry
27+
python -m poetry install
28+
python -m poetry self add poetry-plugin-export
29+
python -m poetry export -f requirements.txt --output requirements.txt
2730
python -m pip install -r requirements.txt
2831
2932
- name: Lint with Ruff
3033
run: |
3134
python -m pip install -U ruff
32-
ruff -v --per-file-ignores="__init__.py:F401" .
35+
ruff --per-file-ignores="__init__.py:F401" --per-file-ignores="__init__.py:E402" .
3336
continue-on-error: true
3437

3538
- name: Test with pytest

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@
33

44

55
<!-- PROJECT SHIELDS -->
6-
<!--
7-
*** I'm using markdown "reference style" links for readability.
8-
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
9-
*** See the bottom of this document for the declaration of the reference variables
10-
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
11-
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
12-
-->
13-
[![Contributors][contributors-shield]][contributors-url]
14-
[![Forks][forks-shield]][forks-url]
15-
[![Stargazers][stars-shield]][stars-url]
16-
[![Issues][issues-shield]][issues-url]
17-
[![BSD-3-Clause License][license-shield]][license-url]
18-
[![LinkedIn][linkedin-shield]][linkedin-url]
6+
<div align="center">
7+
8+
<a href="[contributors-url]">[![Contributors][contributors-shield]][contributors-url]</a>
9+
<a href="[forks-url]">[![Forks][forks-shield]][forks-url]</a>
10+
<a href="[stars-url]">[![Stargazers][stars-shield]][stars-url]</a>
11+
<a href="[issues-url]">[![Issues][issues-shield]][issues-url]</a>
12+
<a href="[license-url]">[![BSD-3-Clause License][license-shield]][license-url]</a>
13+
<a href="[linkedin-url]">[![LinkedIn][linkedin-shield]][linkedin-url]</a>
14+
15+
</div>
1916

2017
<!-- PROJECT LOGO -->
2118
<br />
@@ -94,11 +91,11 @@ Our docs are [here!](/docs/getting-started.md)
9491
<!-- ROADMAP -->
9592
## Roadmap
9693

97-
- [x] Bug fixes
98-
- [x] Set Thread class to inherit from threading.Thread
99-
- [x] Add kill method
100-
- [x] Docs Update
101-
- [ ] v0.1.2 Release
94+
- [x] v0.1.3 Release
95+
- [ ] Bug fixes
96+
- [ ] New features
97+
- [ ] Testing
98+
- [ ] Next release...
10299

103100
See the [open issues](https://github.com/caffeine-addictt/thread/issues) for a full list of proposed features (and known issues).
104101

@@ -138,6 +135,8 @@ Distributed under the BSD-3-Clause License. See `LICENSE.txt` for more informati
138135

139136
Alex - junxiangng63@gmail.com
140137

138+
Project Board: https://github.com/users/caffeine-addictt/projects/5
139+
141140
Project Link: [https://github.com/caffeine-addictt/thread](https://github.com/caffeine-addictt/thread)
142141

143142
<p align="right">(<a href="#readme-top">back to top</a>)</p>

docs/command-line.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ I will lay out how to use the comamnd line!
66
<details>
77
<summary>Jump to</summary>
88
<ul>
9-
<li><a href='#importing-the-class'> Import the class</a></li>
10-
<li><a href='#initializing-a-thread'> Initialize a thread </a></li>
11-
<li><a href='#parameters'> Parameters </a></li>
12-
<li><a href='#attributes'> Attributes </a></li>
13-
<li><a href='#methods'> Class Methods </a></li>
14-
<li><a href='#behviours'> Behaviours </a></li>
9+
<li><a href='#getting-started'> Getting Started </a></li>
10+
<li><a href='#log-levels'> Log Levels </a></li>
11+
<li><a href='#commands'> Commands </a></li>
12+
<details>
13+
<summary>List</summary>
14+
<ul>
15+
<li><a href='#documentation-thread-docs'> thread docs </a></li>
16+
<li><a href='#help-thread-help'> thread help </a></li>
17+
<li><a href='#report-thread-report'> thread report </a></li>
18+
<li><a href='#configuration-thread-config'> thread config </a></li>
19+
<li><a href='#parallel-processing-thread-process'> thread process ... </a></li>
20+
</ul>
21+
</details>
1522
</ul>
23+
1624
</details>
1725

1826

@@ -58,6 +66,9 @@ List of commands
5866

5967
### Documentation (thread docs)
6068

69+
```sh
70+
$ thread docs
71+
```
6172
Ran with no arguments and options, this command will attempt to open your brower to this MD file!
6273
<br />
6374
If unable, will instead print out the link.
@@ -67,6 +78,9 @@ If unable, will instead print out the link.
6778

6879
### Help (thread help)
6980

81+
```sh
82+
$ thread help
83+
```
7084
Ran with no arguments and options, this command will attempt to open your brower to the issue tracker!
7185
<br />
7286
If unable, will instead print out the link.
@@ -76,6 +90,9 @@ If unable, will instead print out the link.
7690

7791
### Report (thread report)
7892

93+
```sh
94+
$ thread report
95+
```
7996
Ran with no arguments and options, this command will attempt to open your brower to this MD file!
8097
<br />
8198
If unable, will instead print out the link.
@@ -85,6 +102,9 @@ If unable, will instead print out the link.
85102

86103
### Configuration (thread config ...)
87104

105+
```sh
106+
$ thread config
107+
```
88108
Comming soon.
89109

90110

@@ -93,7 +113,11 @@ Comming soon.
93113

94114
### Parallel Processing (thread process ...)
95115

116+
```sh
117+
$ thread process
118+
```
96119
Invokes the [parallel processing class](parallel-processing.md#importing-the-class)<br />
120+
<br />
97121

98122
> **Help Command Output**
99123
@@ -107,14 +131,15 @@ $ thread process 'lambda x: x**2' '[ i for i in range(1000) ]'
107131
$ thread process home.Downloads.clean_data:clean ./dataset.csv -t 20
108132
=> The same as:
109133
from home.Downloads.clean_data import clean
110-
dataset = open('dataset.csv', 'r')
134+
dataset = open('./dataset.csv', 'r')
111135

112136
newProcess = ParallelProcess(
113137
target = clean,
114138
dataset = dataset,
115139
max_threads = 20
116140
)
117141
newProcess.start()
142+
dataset.close()
118143

119144
prints or writes to file the result
120145
```

docs/configuration.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Thread Configuration Documentation
2+
3+
I will lay out the configuration options!
4+
5+
<br />
6+
<details>
7+
<summary>Jump to</summary>
8+
<ul>
9+
<li><a href='#importing-the-class'> Import the class </a></li>
10+
<li><a href='#graceful-exiting'> Graceful Exit </a></li>
11+
</ul>
12+
</details>
13+
14+
15+
Don't have the thread library? [See here](./getting-started.md) for installing thread
16+
17+
---
18+
19+
## Importing the class
20+
21+
```py
22+
from thread import Thread
23+
```
24+
25+
<br />
26+
27+
28+
## Graceful Exiting
29+
30+
```py
31+
from thread import Settings
32+
33+
# Enable/Disable graceful exiting
34+
Settings.set_graceful_exit(True)
35+
Settings.set_graceful_exit(False)
36+
```
37+
38+
<br />
39+
40+
41+
Now you know the configuration options available!
42+
43+
[See here](./parallel-processing.md) for how to using the `thread.ParallelProcessing` class!

docs/images/process_help.png

18 KB
Loading

docs/threading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ I will lay out how to use the `thread.Thread` class!
66
<details>
77
<summary>Jump to</summary>
88
<ul>
9-
<li><a href='#importing-the-class'> Import the class</a></li>
9+
<li><a href='#importing-the-class'> Import the class </a></li>
1010
<li><a href='#initializing-a-thread'> Initialize a thread </a></li>
1111
<li><a href='#parameters'> Parameters </a></li>
1212
<li><a href='#attributes'> Attributes </a></li>

poetry.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "thread"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
description = "Threading module extension"
55
authors = ["Alex <taboez4life@gmail.com>"]
66
license = "BSD-3-Clause"
@@ -12,7 +12,7 @@ repository = "https://github.com/caffeine-addictt/thread"
1212
documentation = "https://github.com/caffeine-addictt/thread/blob/main/docs/getting-started.md"
1313
keywords = ["threading", "extension", "multiprocessing"]
1414
classifiers = [
15-
"Development Status :: 1 - Planning",
15+
"Development Status :: 3 - Alpha",
1616
"Intended Audience :: Developers",
1717
"License :: OSI Approved :: BSD License"
1818
]

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/thread/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55

66
from . import (
77
exceptions
8-
)
8+
)
9+
10+
from .utils import Settings

src/thread/cli/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
Import and config CLI commands
33
"""
44

5-
__version__ = '0.1.2'
6-
from ..config import logging, ColorLogger
5+
__version__ = '0.1.3'
6+
from ..utils.logging_config import logging, ColorLogger
77
logging.setLoggerClass(ColorLogger)
88

99

1010
# Import #
1111
from .base import cli_base as app
1212
from .process import process as process_cli
1313

14-
app.command(name = 'process')(process_cli)
14+
app.command(
15+
name = 'process',
16+
no_args_is_help = True,
17+
context_settings = {'allow_extra_args': True}
18+
)(process_cli)

0 commit comments

Comments
 (0)