Skip to content

Commit a11721e

Browse files
committed
Claude...
1 parent d1fb016 commit a11721e

File tree

16 files changed

+391
-105
lines changed

16 files changed

+391
-105
lines changed

.editorconfig

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Universal settings
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
14+
# Python files
15+
[*.py]
16+
indent_size = 4
17+
max_line_length = 100
18+
19+
# YAML files
20+
[*.{yml,yaml}]
21+
indent_size = 2
22+
23+
# JSON files
24+
[*.json]
25+
indent_size = 2
26+
27+
# JavaScript/TypeScript files
28+
[*.{js,ts,jsx,tsx}]
29+
indent_size = 2
30+
31+
# HTML/CSS files
32+
[*.{html,css,scss,sass}]
33+
indent_size = 2
34+
35+
# Markdown files
36+
[*.md]
37+
trim_trailing_whitespace = false
38+
max_line_length = 0
39+
40+
# Makefile
41+
[Makefile]
42+
indent_style = tab
43+
44+
# Shell scripts
45+
[*.{sh,bash}]
46+
indent_size = 2
47+
48+
# Configuration files
49+
[*.{ini,cfg,conf}]
50+
indent_size = 4
51+
52+
# TOML files
53+
[*.toml]
54+
indent_size = 4

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
uses: actions/cache@v3
2828
with:
2929
path: ~/.cache/pip
30-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
30+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
3131
restore-keys: |
3232
${{ runner.os }}-pip-
3333
3434
- name: Install dependencies
3535
run: |
3636
python -m pip install --upgrade pip
37-
pip install -r requirements.txt
37+
pip install -r requirements-dev.txt
3838
pip install -e .
3939
4040
- name: Run linting

.github/workflows/pre-commit.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, master, develop]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.11'
16+
- uses: pre-commit/action@v3.0.0

.pylintrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[MASTER]
2+
# Python code to execute
3+
init-hook='import sys; sys.path.append("src")'
4+
5+
[MESSAGES CONTROL]
6+
disable=
7+
C0111, # missing-docstring
8+
C0103, # invalid-name
9+
C0301, # line-too-long (handled by black)
10+
R0903, # too-few-public-methods
11+
R0913, # too-many-arguments
12+
W0212, # protected-access
13+
W0622, # redefined-builtin
14+
15+
[FORMAT]
16+
max-line-length=100
17+
max-module-lines=1000
18+
19+
[BASIC]
20+
good-names=i,j,k,ex,Run,_,id,ip,ws
21+
22+
[DESIGN]
23+
max-args=7
24+
max-locals=15
25+
max-returns=6
26+
max-branches=12
27+
max-statements=50
28+
max-parents=7
29+
max-attributes=10
30+
min-public-methods=1
31+
max-public-methods=20
32+
33+
[IMPORTS]
34+
allow-wildcard-with-all=no
35+
36+
[EXCEPTIONS]
37+
overgeneral-exceptions=Exception

CONTRIBUTING.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to PubSub WebSocket
1+
# Contributing to Python Publisher Subscriber
22

3-
First off, thank you for considering contributing to PubSub WebSocket! It's people like you that make PubSub WebSocket such a great tool.
3+
First off, thank you for considering contributing to Python Publisher Subscriber! It's people like you that make Python Publisher Subscriber such a great tool.
44

55
## Code of Conduct
66

@@ -27,14 +27,14 @@ Enhancement suggestions are tracked as GitHub issues. When creating an enhanceme
2727
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
2828
* **Provide specific examples to demonstrate the steps**.
2929
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
30-
* **Explain why this enhancement would be useful** to most PubSub WebSocket users.
30+
* **Explain why this enhancement would be useful** to most Python Publisher Subscriber users.
3131

3232
### Your First Code Contribution
3333

3434
Unsure where to begin contributing? You can start by looking through these `beginner` and `help-wanted` issues:
3535

36-
* [Beginner issues](https://github.com/yourusername/pubsub-websocket/labels/beginner) - issues which should only require a few lines of code.
37-
* [Help wanted issues](https://github.com/yourusername/pubsub-websocket/labels/help%20wanted) - issues which should be a bit more involved than `beginner` issues.
36+
* Beginner issues - issues which should only require a few lines of code.
37+
* Help wanted issues - issues which should be a bit more involved than `beginner` issues.
3838

3939
### Pull Requests
4040

@@ -49,11 +49,12 @@ Unsure where to begin contributing? You can start by looking through these `begi
4949

5050
1. **Setup your environment:**
5151
```bash
52-
git clone https://github.com/yourusername/pubsub-websocket.git
53-
cd pubsub-websocket
52+
git clone https://github.com/venantvr/Python.Publisher.Subscriber.git
53+
cd Python.Publisher.Subscriber
5454
python -m venv venv
5555
source venv/bin/activate
56-
pip install -e ".[dev]"
56+
pip install -r requirements-dev.txt
57+
pip install -e .
5758
pre-commit install
5859
```
5960

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 PubSub WebSocket
3+
Copyright (c) 2024 venantvr
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include README.md
2+
include LICENSE
3+
include CONTRIBUTING.md
4+
include requirements.txt
5+
include requirements-dev.txt
6+
include setup.cfg
7+
include pyproject.toml
8+
include Makefile
9+
include Dockerfile
10+
include docker-compose.yml
11+
include .coveragerc
12+
include .gitignore
13+
include .pre-commit-config.yaml
14+
15+
recursive-include src *.py
16+
recursive-include tests *.py
17+
recursive-include static *
18+
recursive-include migrations *.py *.sql
19+
recursive-include docs *.md *.rst *.txt
20+
recursive-include config *.conf *.yaml *.yml
21+
recursive-include .github *.yml *.yaml
22+
23+
global-exclude __pycache__
24+
global-exclude *.py[co]
25+
global-exclude .DS_Store
26+
global-exclude *.swp
27+
global-exclude *~
28+
global-exclude .coverage
29+
global-exclude coverage.xml
30+
global-exclude coverage.json

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help install install-dev test test-cov lint format clean run-server run-client build docker-build docker-run
1+
.PHONY: help install install-dev test test-cov lint format clean run-server run-client build docker-build docker-run pre-commit docs docs-serve
22

33
help: ## Show this help message
44
@echo "Usage: make [target]"
@@ -10,7 +10,8 @@ install: ## Install production dependencies
1010
pip install -r requirements.txt
1111

1212
install-dev: ## Install development dependencies
13-
pip install -e ".[dev]"
13+
pip install -r requirements-dev.txt
14+
pip install -e .
1415
pre-commit install
1516

1617
test: ## Run tests
@@ -44,7 +45,7 @@ clean: ## Clean up generated files
4445
rm -rf coverage/
4546
rm -rf htmlcov/
4647
rm -f coverage.xml coverage.json .coverage
47-
rm -rf dist/ build/ *.egg-info
48+
rm -rf dist/ build/ *.egg-info src/*.egg-info
4849

4950
run-server: ## Run the WebSocket server
5051
python src/pubsub_ws.py
@@ -56,10 +57,10 @@ build: ## Build the package
5657
python -m build
5758

5859
docker-build: ## Build Docker image
59-
docker build -t pubsub-websocket:latest .
60+
docker build -t python.publisher.subscriber:latest .
6061

6162
docker-run: ## Run Docker container
62-
docker run -p 5000:5000 pubsub-websocket:latest
63+
docker run -p 5000:5000 python.publisher.subscriber:latest
6364

6465
pre-commit: ## Run pre-commit hooks
6566
pre-commit run --all-files

README.md

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
# PubSub WebSocket Server
1+
# Python Publisher Subscriber
22

33
<div align="center">
44

55
![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
66
![License](https://img.shields.io/badge/license-MIT-green)
77
![Flask](https://img.shields.io/badge/Flask-3.0.0-red)
88
![WebSocket](https://img.shields.io/badge/WebSocket-Enabled-brightgreen)
9-
[![codecov](https://codecov.io/gh/yourusername/pubsub-websocket/branch/main/graph/badge.svg)](https://codecov.io/gh/yourusername/pubsub-websocket)
10-
[![Documentation Status](https://readthedocs.org/projects/pubsub-websocket/badge/?version=latest)](https://pubsub-websocket.readthedocs.io/en/latest/?badge=latest)
11-
[![PyPI version](https://badge.fury.io/py/pubsub-websocket.svg)](https://badge.fury.io/py/pubsub-websocket)
12-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
13-
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
14-
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
15-
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
9+
![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)
10+
![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)
11+
![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)
12+
![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)
1613

1714
A high-performance, real-time Publisher-Subscriber system built with Flask, Flask-SocketIO, and SQLite.
1815

19-
[Features](#-features)[Installation](#-installation)[Quick Start](#-quick-start)[Documentation](#-documentation)[Contributing](#-contributing)
16+
[Features](#-features)[Installation](#-installation)[Quick Start](#-quick-start)[Contributing](#-contributing)
2017

2118
</div>
2219

@@ -44,25 +41,20 @@ A high-performance, real-time Publisher-Subscriber system built with Flask, Flas
4441

4542
## 🔧 Installation
4643

47-
### From PyPI (Recommended)
48-
49-
```bash
50-
pip install pubsub-websocket
51-
```
52-
5344
### From Source
5445

5546
```bash
5647
# Clone the repository
57-
git clone https://github.com/yourusername/pubsub-websocket.git
58-
cd pubsub-websocket
48+
git clone https://github.com/venantvr/Python.Publisher.Subscriber.git
49+
cd Python.Publisher.Subscriber
5950

6051
# Create virtual environment
6152
python -m venv venv
6253
source venv/bin/activate # On Windows: venv\Scripts\activate
6354

6455
# Install in development mode
65-
pip install -e ".[dev]"
56+
pip install -r requirements-dev.txt
57+
pip install -e .
6658
```
6759

6860
### Using Docker
@@ -72,19 +64,16 @@ pip install -e ".[dev]"
7264
docker-compose up -d
7365

7466
# Or build and run manually
75-
docker build -t pubsub-websocket:latest .
76-
docker run -p 5000:5000 pubsub-websocket:latest
67+
docker build -t python.publisher.subscriber:latest .
68+
docker run -p 5000:5000 python.publisher.subscriber:latest
7769
```
7870

7971
## 🚀 Quick Start
8072

8173
### 1. Start the Server
8274

8375
```bash
84-
# Using the installed package
85-
pubsub-server
86-
87-
# Or run directly
76+
# Run directly
8877
python src/pubsub_ws.py
8978

9079
# Or using Make
@@ -148,7 +137,7 @@ Open your browser at `http://localhost:5000/client.html`
148137
## 📁 Project Structure
149138

150139
```
151-
pubsub-websocket/
140+
Python.Publisher.Subscriber/
152141
├── src/ # Source code
153142
│ ├── pubsub/ # Core library modules
154143
│ │ ├── __init__.py
@@ -332,14 +321,14 @@ docker-compose down
332321

333322
```bash
334323
# Build image
335-
docker build -t pubsub-websocket:latest .
324+
docker build -t python.publisher.subscriber:latest .
336325

337326
# Run container
338327
docker run -d \
339328
-p 5000:5000 \
340329
-v $(pwd)/pubsub.db:/app/pubsub.db \
341330
--name pubsub-server \
342-
pubsub-websocket:latest
331+
python.publisher.subscriber:latest
343332
```
344333

345334
## 📈 Monitoring
@@ -387,7 +376,7 @@ Contributions are welcome! Please follow these steps:
387376

388377
## 📄 License
389378

390-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
379+
This project is licensed under the MIT License - see the LICENSE file for details.
391380

392381
## 🙏 Acknowledgments
393382

@@ -397,13 +386,13 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
397386

398387
## 📚 Documentation
399388

400-
Full documentation is available at [https://pubsub-websocket.readthedocs.io](https://pubsub-websocket.readthedocs.io)
389+
Full documentation is available in the `docs/` directory.
401390

402391
## 📧 Support
403392

404-
- **Issues**: [GitHub Issues](https://github.com/yourusername/pubsub-websocket/issues)
405-
- **Discussions**: [GitHub Discussions](https://github.com/yourusername/pubsub-websocket/discussions)
406-
- **Email**: your.email@example.com
393+
- **Issues**: GitHub Issues
394+
- **Discussions**: GitHub Discussions
395+
- **Email**: venantvr@gmail.com
407396

408397
## 🗺️ Roadmap
409398

@@ -421,5 +410,5 @@ Full documentation is available at [https://pubsub-websocket.readthedocs.io](htt
421410
---
422411

423412
<div align="center">
424-
Made with ❤️ by the PubSub WebSocket team
413+
Made with ❤️ by the Python Publisher Subscriber team
425414
</div>

0 commit comments

Comments
 (0)