Skip to content

Commit 2c89a84

Browse files
authored
Upgrading and updating code base to latest versions.
* Sync with latest of https://github.com/Alir3z4/stop-words. * Add much more tests and cleaned up the code. * Modernized Python packaging and publishing.
1 parent 2b71bd5 commit 2c89a84

File tree

20 files changed

+1393
-593
lines changed

20 files changed

+1393
-593
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_size = 2
6+
indent_style = space
7+
end_of_line = lf
8+
charset = utf-8
9+
max_line_length = 120
10+
insert_final_newline = true
11+
12+
[*.py]
13+
indent_size = 4
14+
trim_trailing_whitespace = true
15+
16+
17+
[*.rst]
18+
trim_trailing_whitespace = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/workflows/main.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
code-quality:
16+
runs-on: ubuntu-latest
17+
18+
name: "Linting"
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 0
23+
24+
- name: setup python
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: '3.13'
28+
29+
- name: Install dependencies
30+
run: make install
31+
32+
- name: Linting
33+
run: make lint
34+
35+
test:
36+
# The type of runner that the job will run on
37+
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
python-version: ["3.11", "3.12", "3.13", "3.14"]
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
name: "Python ${{ matrix.python-version }}"
44+
45+
steps:
46+
- name: Check out code
47+
uses: actions/checkout@v5
48+
with:
49+
submodules: true
50+
51+
- name: Set up Python ${{ matrix.python-version }}
52+
uses: actions/setup-python@v6
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
56+
- name: Install dependencies
57+
run: make install
58+
59+
- name: Run tests
60+
run: make coverage
61+
62+
- name: Upload coverage to Codecov
63+
uses: codecov/codecov-action@v5
64+
with:
65+
flags: unittests-${{ matrix.python-version }}
66+
fail_ci_if_error: true # default = false
67+
verbose: true # default = false

.github/workflows/pypi.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/project/stop-words
13+
permissions:
14+
id-token: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v5
19+
with:
20+
submodules: true
21+
22+
- uses: actions/setup-python@v6
23+
with:
24+
python-version: '3.13'
25+
26+
- name: Build
27+
run: |
28+
python -m pip install build
29+
make update-submodules build
30+
31+
- name: Publish package distributions to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
with:
34+
verbose: true
35+
print-hash: true

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ build/
1111
dist/
1212
*.egg-info/
1313
logs/
14-
src/
15-
.c9/
1614
bin/
1715
develop-eggs/
1816
eggs/
17+
coverage.xml
18+
.coverage
19+
build
20+
src/stop_words/_version.py

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "stop_words/stop-words"]
2-
path = stop_words/stop-words
1+
[submodule "src/stop_words/stop-words"]
2+
path = src/stop_words/stop-words
33
url = https://github.com/Alir3z4/stop-words.git

.travis.yml

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

ChangeLog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2025.11.4
2+
=========
3+
4+
* Sync with latest of https://github.com/Alir3z4/stop-words.
5+
* Add much more tests and cleaned up the code.
6+
* Modernized Python packaging and publishing.
7+
8+
19
2018.7.23
210
=========
311

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.PHONY: help install test coverage build clean format check-format lint precommit update-submodules
2+
3+
.DEFAULT_GOAL := help
4+
5+
help: ## Display this help message
6+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
7+
8+
install: update-submodules ## Install development dependencies
9+
pip install -e '.[dev]'
10+
11+
update-submodules: ## Update all git submodules
12+
git submodule sync --recursive
13+
git submodule update --init --remote --recursive
14+
15+
test: ## Run test suite
16+
python -m unittest discover -s src/ -v
17+
18+
coverage: ## Generate coverage report
19+
coverage run -m unittest discover -s src/
20+
coverage report
21+
coverage xml
22+
23+
build: ## Build source and wheel distributions
24+
python -m build
25+
26+
clean: ## Remove build artifacts and temporary files
27+
rm -rf build/ dist/ *.egg-info/ **/*.egg-info/ .coverage coverage.xml .mypy_cache/ 88
28+
29+
format: ## Auto-format code with isort and black
30+
isort .
31+
black .
32+
33+
check-format: ## Check code formatting with isort and black
34+
isort --check-only --diff .
35+
black --check --diff .
36+
37+
lint: ## Run all code quality checks
38+
flake8 --config=flake8.ini .
39+
mypy src/ --install-types --non-interactive
40+
41+
precommit: format lint ## Full pre-commit checks (format + lint)
42+
43+
##@ Development Targets

0 commit comments

Comments
 (0)