Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,37 @@ name: Python unit tests

on:
push:
branches: [ "master", "dev" ]
branches: ["master", "dev"]
pull_request:

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[tests]

- name: Run all unit tests
run: |
python -m pytest --cov=. tests

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5.0.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.6" # Pinned version of uv.
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Install the project
run: uv sync --locked --group=tests

- name: Run tests
run: uv run pytest --cov=. tests

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5.0.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
2 changes: 1 addition & 1 deletion client/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import argparse
import sys

from logging_config import configure_logging
from src.logging_config import configure_logging
from src.parse_hostname import parse_hostname
from src.parse_username import parse_username
from src.port_number import PortNumber
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"__pycache__",
"venv",
"docs",
"logging_config.py",
]
apidoc_separate_modules = True
apidoc_toc_file = False
Expand Down
23 changes: 17 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "socket-programming"
version = "1.0.0"
authors = [{ name = "Harry Parkes", email = "harrydparkes@proton.me" }]
description = "Sever-Client program pair capable of delivering messages between clients"
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["rsa"]
dependencies = ["rsa>=4.9"]
license = "AGPL-3.0-only"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Intended Audience :: Education",
]

[project.optional-dependencies]
tests = ["pytest", "pytest-cov"]
lint = ["ruff", "mypy", "pre-commit"]

[project.urls]
"Homepage" = "https://github.com/hazzery/socket-programming"
"Bug Tracker" = "https://github.com/hazzery/socket-programming/issues"

[project.scripts]
client = "client:__main__.main"
server = "server:__main__.main"

[dependency-groups]
tests = ["pytest", "pytest-cov"]
lint = ["ruff", "mypy", "pre-commit"]

[tool.setuptools]
packages = ["client", "server", "src", "src.packets"]

[tool.ruff]
exclude = ["docs/conf.py"]

Expand Down
2 changes: 1 addition & 1 deletion server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
import sys

from logging_config import configure_logging
from src.logging_config import configure_logging
from src.parse_hostname import parse_hostname
from src.port_number import PortNumber

Expand Down
File renamed without changes.
445 changes: 445 additions & 0 deletions uv.lock

Large diffs are not rendered by default.