random-port 0.0.2__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of random-port might be problematic. Click here for more details.
- {random_port-0.0.2/random_port.egg-info → random_port-0.0.4}/PKG-INFO +9 -5
- {random_port-0.0.2 → random_port-0.0.4}/README.md +8 -4
- {random_port-0.0.2 → random_port-0.0.4}/pyproject.toml +1 -1
- {random_port-0.0.2 → random_port-0.0.4/random_port.egg-info}/PKG-INFO +9 -5
- {random_port-0.0.2 → random_port-0.0.4}/random_port.egg-info/SOURCES.txt +1 -1
- {random_port-0.0.2 → random_port-0.0.4}/tests/test_random_port.py +5 -5
- {random_port-0.0.2 → random_port-0.0.4}/LICENSE.txt +0 -0
- {random_port-0.0.2 → random_port-0.0.4}/random_port/__init__.py +0 -0
- /random_port-0.0.2/random_port/core.py → /random_port-0.0.4/random_port/pool.py +0 -0
- {random_port-0.0.2 → random_port-0.0.4}/random_port.egg-info/dependency_links.txt +0 -0
- {random_port-0.0.2 → random_port-0.0.4}/random_port.egg-info/requires.txt +0 -0
- {random_port-0.0.2 → random_port-0.0.4}/random_port.egg-info/top_level.txt +0 -0
- {random_port-0.0.2 → random_port-0.0.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: random_port
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Generate a free TCP or UDP random port
|
|
5
5
|
Author-email: Fabrício Barros Cabral <fabriciofx@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,16 +34,20 @@ in your project folder.
|
|
|
34
34
|
|
|
35
35
|
## Usage
|
|
36
36
|
|
|
37
|
-
- To a TCP random port:
|
|
37
|
+
- To use a TCP random port:
|
|
38
38
|
|
|
39
39
|
```python
|
|
40
|
-
|
|
40
|
+
from random_port.core import TcpRandomPort
|
|
41
|
+
|
|
42
|
+
port = TcpRandomPort().value()
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
- To a UDP random port:
|
|
45
|
+
- To use a UDP random port:
|
|
44
46
|
|
|
45
47
|
```python
|
|
46
|
-
|
|
48
|
+
from random_port.core import UdpRandomPort
|
|
49
|
+
|
|
50
|
+
port = UdpRandomPort().value()
|
|
47
51
|
```
|
|
48
52
|
|
|
49
53
|
## License
|
|
@@ -18,16 +18,20 @@ in your project folder.
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
- To a TCP random port:
|
|
21
|
+
- To use a TCP random port:
|
|
22
22
|
|
|
23
23
|
```python
|
|
24
|
-
|
|
24
|
+
from random_port.core import TcpRandomPort
|
|
25
|
+
|
|
26
|
+
port = TcpRandomPort().value()
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
- To a UDP random port:
|
|
29
|
+
- To use a UDP random port:
|
|
28
30
|
|
|
29
31
|
```python
|
|
30
|
-
|
|
32
|
+
from random_port.core import UdpRandomPort
|
|
33
|
+
|
|
34
|
+
port = UdpRandomPort().value()
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
## License
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "random_port"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.4"
|
|
8
8
|
description = "Generate a free TCP or UDP random port"
|
|
9
9
|
authors = [{ name = "Fabrício Barros Cabral", email = "fabriciofx@gmail.com" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: random_port
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Generate a free TCP or UDP random port
|
|
5
5
|
Author-email: Fabrício Barros Cabral <fabriciofx@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -34,16 +34,20 @@ in your project folder.
|
|
|
34
34
|
|
|
35
35
|
## Usage
|
|
36
36
|
|
|
37
|
-
- To a TCP random port:
|
|
37
|
+
- To use a TCP random port:
|
|
38
38
|
|
|
39
39
|
```python
|
|
40
|
-
|
|
40
|
+
from random_port.core import TcpRandomPort
|
|
41
|
+
|
|
42
|
+
port = TcpRandomPort().value()
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
- To a UDP random port:
|
|
45
|
+
- To use a UDP random port:
|
|
44
46
|
|
|
45
47
|
```python
|
|
46
|
-
|
|
48
|
+
from random_port.core import UdpRandomPort
|
|
49
|
+
|
|
50
|
+
port = UdpRandomPort().value()
|
|
47
51
|
```
|
|
48
52
|
|
|
49
53
|
## License
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
import socket
|
|
23
23
|
|
|
24
|
-
from random_port.
|
|
24
|
+
from random_port.pool import TcpRandomPort, UdpRandomPort
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def test_tcp_random_port() -> None:
|
|
@@ -47,9 +47,9 @@ def test_tcp_in_use() -> None:
|
|
|
47
47
|
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
48
48
|
server.setblocking(False)
|
|
49
49
|
server.bind((host, begin))
|
|
50
|
-
|
|
51
|
-
assert free_port == end
|
|
50
|
+
port = TcpRandomPort(host, begin, end).value()
|
|
52
51
|
server.close()
|
|
52
|
+
assert port == end
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
def test_udp_in_use() -> None:
|
|
@@ -59,6 +59,6 @@ def test_udp_in_use() -> None:
|
|
|
59
59
|
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
60
60
|
server.setblocking(False)
|
|
61
61
|
server.bind((host, begin))
|
|
62
|
-
|
|
63
|
-
assert free_port == end
|
|
62
|
+
port = UdpRandomPort(host, begin, end).value()
|
|
64
63
|
server.close()
|
|
64
|
+
assert port == end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|