Skip to content

Commit 7de41db

Browse files
committed
Added PyPi compatibility
1 parent 24e2903 commit 7de41db

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

.flake8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 120
3+
ignore = E203, W503

Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ run: venv
2121

2222
clean:
2323
@rm -rf $(VENV)
24+
@rm -rf dist
25+
@rm -rf tcp_ip_stack.egg-info
2426
@find . -type d -name '__pycache__' -exec rm -rf {} +
2527

2628
lint: venv
@@ -49,6 +51,18 @@ test: test_unit test_integration
4951
bridge:
5052
@brctl addbr br0
5153

54+
install: venv
55+
@./$(VENV)/bin/pip install -e .
56+
57+
package: venv
58+
@./$(VENV)/bin/python -m build
59+
60+
dist: package
61+
62+
pypi: dist
63+
@./$(VENV)/bin/twine check dist/*
64+
@./$(VENV)/bin/twine upload dist/*
65+
5266
tap:
5367
@ip tuntap add name tap7 mode tap
5468
@ip link set dev tap7 up

pyproject.toml

+14-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
requires-python = ">=3.10"
2626

2727
[project.optional-dependencies]
28-
dev = ["testslide", "black", "mypy", "flake8", "codespell", "isort", "pylint", "click"]
28+
dev = ["click", "testslide", "black", "mypy", "flake8", "codespell", "isort", "pylint", "build", "twine"]
2929

3030
[project.urls]
3131
"Homepage" = "https://github.com/ccie18643/PyTCP"
@@ -42,4 +42,16 @@ honor_noqa = true
4242

4343
[tool.codespell]
4444
quiet-level = 2
45-
ignore-words-list = "ect, ether, nd, tha"
45+
ignore-words-list = "ect, ether, nd, tha"
46+
47+
[tool.mypy]
48+
python_version = "3.10"
49+
check_untyped_defs = true
50+
disallow_untyped_defs = true
51+
disallow_any_unimported = true
52+
disallow_incomplete_defs = true
53+
disallow_untyped_decorators = true
54+
no_implicit_optional = true
55+
warn_return_any = true
56+
warn_unused_ignores = true
57+
show_error_codes = true

requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
click
12
testslide
23
black
34
mypy
45
flake8
56
codespell
67
isort
78
pylint
8-
click
9+
build
10+
twine
11+
ipython

setup.cfg

-15
This file was deleted.

0 commit comments

Comments
 (0)