Skip to content

Commit d94c618

Browse files
authored
Merge pull request #377 from chartbeat-labs/develop
v0.13 release
2 parents 5387957 + 4e0da0e commit d94c618

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1728
-1092
lines changed

.github/workflows/build_and_test.yml

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

.github/workflows/checks.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: checks
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request: # run on all PRs
7+
schedule: # run weekly
8+
- cron: "0 12 * * 0"
9+
10+
jobs:
11+
12+
tests:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.9", "3.10", "3.11"]
18+
os: [macos-latest, ubuntu-latest, windows-latest]
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
cache: "pip"
26+
cache-dependency-path: "pyproject.toml"
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip wheel
30+
python -m pip install -e '.[check]'
31+
- name: Download language data
32+
run: |
33+
make download
34+
- name: Test with pytest
35+
run: |
36+
python -m pytest tests --verbose --cov=textacy --cov-report=term-missing
37+
38+
lint:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v4
44+
with:
45+
python-version: "3.9"
46+
cache: "pip"
47+
cache-dependency-path: "pyproject.toml"
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip wheel
51+
python -m pip install -e '.[check]'
52+
- name: Check formatting with black
53+
run: |
54+
python -m black --diff src
55+
- name: Check imports with isort
56+
run: |
57+
python -m isort --diff src
58+
- name: Check correctness with ruff
59+
run: |
60+
python -m ruff check --exit-zero src
61+
62+
types:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v3
66+
- name: Set up Python ${{ matrix.python-version }}
67+
uses: actions/setup-python@v4
68+
with:
69+
python-version: "3.9"
70+
cache: "pip"
71+
cache-dependency-path: "pyproject.toml"
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip wheel
75+
python -m pip install -e '.[check]'
76+
- name: Check types with mypy
77+
run: |
78+
python -m mypy --install-types --non-interactive src

.github/workflows/docs.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
11
name: docs
22

33
on:
4-
push: # run on every push to default branch
5-
branches: [ $default-branch, main ]
6-
pull_request: # run on all pull requests
4+
push:
5+
branches: [ main, develop ]
76

87
jobs:
98
build:
109
runs-on: ubuntu-latest
1110
strategy:
1211
matrix:
13-
build-type: [ html, text ]
14-
12+
build-type: [html, text]
1513
steps:
16-
- uses: actions/checkout@v2
17-
- name: set up Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: 3.8
21-
- name: get pip cache dir
22-
id: pip-cache
23-
run: |
24-
echo "::set-output name=dir::$(pip cache dir)"
25-
- name: set up pip cache
26-
uses: actions/cache@v2
14+
- uses: actions/checkout@v3
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
2717
with:
28-
path: ${{ steps.pip-cache.outputs.dir }}
29-
key: ${{ matrix.os }}-pip-${{ hashFiles('setup.cfg') }}
30-
restore-keys: |
31-
${{ matrix.os }}-pip-
32-
- name: install package and dependencies
18+
python-version: "3.9"
19+
cache: "pip"
20+
cache-dependency-path: "pyproject.toml"
21+
- name: Install dependencies
3322
run: |
3423
python -m pip install --upgrade pip wheel
35-
python -m pip install -e .[docs]
24+
python -m pip install -e '.[docs]'
3625
- name: make ${{ matrix.build-type }} docs
3726
run: |
3827
cd docs && make ${{ matrix.build-type }}

.github/workflows/lint_and_format.yml

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

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.9"
16+
cache: "pip"
17+
cache-dependency-path: "pyproject.toml"
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install build wheel
22+
- name: Build package
23+
run: |
24+
python -m build --sdist --wheel
25+
- name: Publish package to TestPyPI
26+
uses: pypa/gh-action-pypi-publish@release/v1.6
27+
with:
28+
user: __token__
29+
password: ${{ secrets.TEST_PYPI_API_TOKEN_BURTON }}
30+
repository_url: https://test.pypi.org/legacy/
31+
- name: Publish package to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1.6
33+
with:
34+
user: __token__
35+
password: ${{ secrets.PYPI_API_TOKEN_BURTON }}
36+
verify_metadata: true
37+
verbose: true

.github/workflows/publish_package.yml

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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ venv.bak/
6767
.dmypy.json
6868
dmypy.json
6969

70+
# ruff
71+
.ruff_cache/
72+
7073
# textacy
7174
data/
7275

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
version: 2
55

66
python:
7-
version: 3.8
7+
version: 3.9
88
install:
99
- method: pip
1010
path: .

CHANGES.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
## Changes
22

3+
### 0.13.0 (2023-04-02)
4+
5+
- upgraded built-in language identification model (PR #375)
6+
- replaced v2 thinc/cld3 model with v3 floret/fasttext model, which has much faster predictions and comparable but more consistent performance
7+
- modernized and improved Python packaging for faster, simpler installation and testing (PR #368 and #369)
8+
- all package metadata and configuration moved into a single `pyproject.toml` file
9+
- code formatting and linting updated to use `ruff` plus newer versions of `mypy` and `black`, and their use in GitHub Actions CI has been consolidated
10+
- bumped supported Python versions range from 3.8–3.10 to 3.9–3.11 (PR #369)
11+
- added full CI testing matrix for PY 3.9/3.10/3.11 x Linux/macOS/Windows, and removed extraneous AppVeyor integration
12+
- updated and improved type hints throughout, reducing number of `mypy` complaints by ~80% (PR #372)
13+
14+
#### Fixed
15+
16+
- fixed ReDoS bugs in regex patterns (PR #371)
17+
- fixed breaking API issues with newer networkx/scikit-learn versions (PR #367)
18+
- improved dev workflow documentation and code to better incorporate language data (PR #363)
19+
- updated caching code with a fix from upstream pysize library, which was preventing Russian-language spaCy model from loading properly (PR #358)
20+
21+
#### Contributors
22+
23+
Big thanks to @jonwiggins, @Hironsan, amnd @kevinbackhouse for the fixes!
24+
25+
326
### 0.12.0 (2021-12-06)
427

528
- Refactored and extended text statistics functionality (PR #350)
@@ -43,6 +66,7 @@
4366

4467
Thanks to @austinjp, @scarroll32, @MirkoLenz for their help!
4568

69+
4670
### 0.11.0 (2021-04-12)
4771

4872
- **Refactored, standardized, and extended several areas of functionality**

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ Use an appropriate template (if available) when [creating your issue](https://gi
4747

4848
1. **Implement your changes:** Use your preferred text editor to modify the `textacy` source code. Be sure to keep your changes focused and in scope, and follow the coding conventions described below! Document your code as you write it. Run your changes against any existing tests and add new ones as needed to validate your changes; make sure you don’t accidentally break existing functionality! Several common commands can be accessed via the package `Makefile`:
4949

50-
$ make test
51-
$ make lint
52-
$ make mypy
50+
$ make download
51+
$ make check-tests
52+
$ make check-lint
53+
$ make check-types
5354

54-
Or, to run all three at once, use
55+
Or, to run the latter three steps at once, use
5556

5657
$ make check
5758

0 commit comments

Comments
 (0)