Skip to content
Merged
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
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# http://editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
max_line_length = 120
insert_final_newline = true

[*.py]
indent_size = 4
trim_trailing_whitespace = true


[*.rst]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
code-quality:
runs-on: ubuntu-latest

name: "Linting"
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: setup python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install dependencies
run: make install

- name: Linting
run: make lint

test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: "Python ${{ matrix.python-version }}"

steps:
- name: Check out code
uses: actions/checkout@v5
with:
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: make install

- name: Run tests
run: make coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
flags: unittests-${{ matrix.python-version }}
fail_ci_if_error: true # default = false
verbose: true # default = false
35 changes: 35 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to PyPI

on:
release:
types: [released]

jobs:
release:
name: Release
environment:
name: pypi
url: https://pypi.org/project/stop-words
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true

- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Build
run: |
python -m pip install build
make update-submodules build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ build/
dist/
*.egg-info/
logs/
src/
.c9/
bin/
develop-eggs/
eggs/
coverage.xml
.coverage
build
src/stop_words/_version.py
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "stop_words/stop-words"]
path = stop_words/stop-words
[submodule "src/stop_words/stop-words"]
path = src/stop_words/stop-words
url = https://github.com/Alir3z4/stop-words.git
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2025.11.4
=========

* Sync with latest of https://github.com/Alir3z4/stop-words.
* Add much more tests and cleaned up the code.
* Modernized Python packaging and publishing.


2018.7.23
=========

Expand Down
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.PHONY: help install test coverage build clean format check-format lint precommit update-submodules

.DEFAULT_GOAL := help

help: ## Display this help message
@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)

install: update-submodules ## Install development dependencies
pip install -e '.[dev]'

update-submodules: ## Update all git submodules
git submodule sync --recursive
git submodule update --init --remote --recursive

test: ## Run test suite
python -m unittest discover -s src/ -v

coverage: ## Generate coverage report
coverage run -m unittest discover -s src/
coverage report
coverage xml

build: ## Build source and wheel distributions
python -m build

clean: ## Remove build artifacts and temporary files
rm -rf build/ dist/ *.egg-info/ **/*.egg-info/ .coverage coverage.xml .mypy_cache/ 88

format: ## Auto-format code with isort and black
isort .
black .

check-format: ## Check code formatting with isort and black
isort --check-only --diff .
black --check --diff .

lint: ## Run all code quality checks
flake8 --config=flake8.ini .
mypy src/ --install-types --non-interactive

precommit: format lint ## Full pre-commit checks (format + lint)

##@ Development Targets
Loading