Skip to content

Commit

Permalink
Merge pull request #377 from chartbeat-labs/develop
Browse files Browse the repository at this point in the history
v0.13 release
  • Loading branch information
bdewilde authored Apr 2, 2023
2 parents 5387957 + 4e0da0e commit d94c618
Show file tree
Hide file tree
Showing 75 changed files with 1,728 additions and 1,092 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/build_and_test.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: checks

on:
push:
branches: [ main, develop ]
pull_request: # run on all PRs
schedule: # run weekly
- cron: "0 12 * * 0"

jobs:

tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e '.[check]'
- name: Download language data
run: |
make download
- name: Test with pytest
run: |
python -m pytest tests --verbose --cov=textacy --cov-report=term-missing
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e '.[check]'
- name: Check formatting with black
run: |
python -m black --diff src
- name: Check imports with isort
run: |
python -m isort --diff src
- name: Check correctness with ruff
run: |
python -m ruff check --exit-zero src
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e '.[check]'
- name: Check types with mypy
run: |
python -m mypy --install-types --non-interactive src
33 changes: 11 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
name: docs

on:
push: # run on every push to default branch
branches: [ $default-branch, main ]
pull_request: # run on all pull requests
push:
branches: [ main, develop ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [ html, text ]

build-type: [html, text]
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: set up pip cache
uses: actions/cache@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ matrix.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ matrix.os }}-pip-
- name: install package and dependencies
python-version: "3.9"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e .[docs]
python -m pip install -e '.[docs]'
- name: make ${{ matrix.build-type }} docs
run: |
cd docs && make ${{ matrix.build-type }}
26 changes: 0 additions & 26 deletions .github/workflows/lint_and_format.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
- name: Build package
run: |
python -m build --sdist --wheel
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1.6
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN_BURTON }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.6
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_BURTON }}
verify_metadata: true
verbose: true
27 changes: 0 additions & 27 deletions .github/workflows/publish_package.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ venv.bak/
.dmypy.json
dmypy.json

# ruff
.ruff_cache/

# textacy
data/

Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version: 2

python:
version: 3.8
version: 3.9
install:
- method: pip
path: .
Expand Down
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
## Changes

### 0.13.0 (2023-04-02)

- upgraded built-in language identification model (PR #375)
- replaced v2 thinc/cld3 model with v3 floret/fasttext model, which has much faster predictions and comparable but more consistent performance
- modernized and improved Python packaging for faster, simpler installation and testing (PR #368 and #369)
- all package metadata and configuration moved into a single `pyproject.toml` file
- 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
- bumped supported Python versions range from 3.8–3.10 to 3.9–3.11 (PR #369)
- added full CI testing matrix for PY 3.9/3.10/3.11 x Linux/macOS/Windows, and removed extraneous AppVeyor integration
- updated and improved type hints throughout, reducing number of `mypy` complaints by ~80% (PR #372)

#### Fixed

- fixed ReDoS bugs in regex patterns (PR #371)
- fixed breaking API issues with newer networkx/scikit-learn versions (PR #367)
- improved dev workflow documentation and code to better incorporate language data (PR #363)
- updated caching code with a fix from upstream pysize library, which was preventing Russian-language spaCy model from loading properly (PR #358)

#### Contributors

Big thanks to @jonwiggins, @Hironsan, amnd @kevinbackhouse for the fixes!


### 0.12.0 (2021-12-06)

- Refactored and extended text statistics functionality (PR #350)
Expand Down Expand Up @@ -43,6 +66,7 @@

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


### 0.11.0 (2021-04-12)

- **Refactored, standardized, and extended several areas of functionality**
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ Use an appropriate template (if available) when [creating your issue](https://gi

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`:

$ make test
$ make lint
$ make mypy
$ make download
$ make check-tests
$ make check-lint
$ make check-types

Or, to run all three at once, use
Or, to run the latter three steps at once, use

$ make check

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ graft src
graft scripts
graft tests
graft docs
prune src/textacy/data/
prune docs/build/

include CHANGES.md
Expand Down
29 changes: 19 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean-build clean-py clean-test clean test lint check-types
.PHONY: clean-build clean-py clean-test clean check-tests check-lint check-types check build download

clean-build:
rm -rf dist build .egg .eggs **/*.egg-info
Expand All @@ -13,16 +13,25 @@ clean-test:

clean: clean-build clean-py clean-test

build: clean-build
python -m build --sdist --wheel
check-tests: clean-test
python -m pytest tests --verbose --cov=textacy --cov-report=term-missing

test: clean-test
python -m pytest tests -v --cov=textacy --cov-report=term-missing
check-lint:
python -m black --diff src
python -m isort --diff src
python -m ruff check src

lint:
python -m flake8 src

mypy:
check-types:
python -m mypy src

check: test lint mypy
check: check-tests check-lint check-types

build: clean-build
python -m build --sdist --wheel

download:
python -m spacy download en_core_web_sm
python -m spacy download es_core_news_sm
python -m spacy validate
python -m textacy download capitol_words
python -m textacy download lang_identifier --version 3.0
Loading

0 comments on commit d94c618

Please sign in to comment.