Skip to content

Commit

Permalink
Merge branch 'dev' into fix-xml
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Feb 15, 2024
2 parents 605a0af + 411eadd commit 369a3eb
Show file tree
Hide file tree
Showing 82 changed files with 3,876 additions and 3,310 deletions.
14 changes: 0 additions & 14 deletions .coveragerc

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
80 changes: 80 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: build
on:
push:
branches: ["dev"]
tags: ["*"]
pull_request:

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { name: "3.8", python: "3.8", tox: py38 }
- { name: "3.12", python: "3.12", tox: py312 }
- { name: "lowest", python: "3.8", tox: py38-lowest }
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Download nltk data
run: wget https://s3.amazonaws.com/textblob/nltk_data-0.11.0.tar.gz
- name: Extract nltk data
run: tar -xzvf nltk_data-0.11.0.tar.gz -C ~
- run: python -m pip install tox
- run: python -m tox -e${{ matrix.tox }}
build:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Install twine
run: python -m pip install twine
- name: Check build
run: python -m twine check --strict dist/*
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
# this duplicates pre-commit.ci, so only run it on tags
# it guarantees that linting is passing prior to a release
lint-pre-release:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: python -m pip install tox
- run: python -m tox -e lint
publish-to-pypi:
name: PyPI release
if: startsWith(github.ref, 'refs/tags/')
needs: [build, tests, lint-pre-release]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/textblob
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
36 changes: 18 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
### Python ###

*.py[cod]

# virtualenv
.venv/
venv/

# C extensions
*.so

Expand All @@ -19,16 +21,17 @@ develop-eggs
.installed.cfg
lib
lib64
__pycache__
cover

# Installer logs
# pip
pip-log.txt
pip-wheel-metadata

# Unit test / coverage reports
.coverage
.tox
nosetests.xml
test-output/
.pytest_cache

# Translations
*.mo
Expand All @@ -38,22 +41,19 @@ nosetests.xml
.project
.pydevproject

*.bak
.bumpversion.cfg
# Complexity
output/*.html
output/*/index.html

# Docs
# Sphinx
docs/_build
README.html

# Pylint
pylintrc

### Extra models and data ###
# mypy

text/*.pickle
text/en/*.pickle
.mypy_cache

# Readme build
README.html
!tests/.env

.ipynb_checkpoints/
*.ipynb
# ruff
.ruff_cache
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
hooks:
- id: check-github-workflows
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.12.1]
15 changes: 15 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
sphinx:
configuration: docs/conf.py
formats:
- pdf
build:
os: ubuntu-22.04
tools:
python: "3.11"
python:
install:
- method: pip
path: .
extra_requirements:
- docs
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ Contributors (chronological)
- Jamie Moschella `@jammmo <https://github.com/jammmo>`_
- Roman Korolev `@roman-y-korolev <https://github.com/roman-y-korolev>`_
- Ram Rachum `@cool-RR <https://github.com/cool-RR>`_
- Romain Casati `@casatir <https://github.com/casatir>`_
- Evgeny Kemerov `@sudoguy <https://github.com/sudoguy>`_
28 changes: 27 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
Changelog
=========

0.17.0 (unreleased)
0.18.0 (unreleased)
-------------------

Removals:

- ``TextBlob.translate()`` and ``TextBlob.detect_language``, and ``textblob.translate``
are removed. Use the official Google Translate API instead (:issue:`215`).
- Remove ``textblob.compat``.

Support:

- Support Python 3.8-3.12. Older versions are no longer supported.
- Support nltk>=3.8.

0.17.1 (2021-10-21)
-------------------

Bug fixes:

- Fix translation and language detection (:issue:`395`).
Thanks :user:`sudoguy` for the patch.

0.17.0 (2021-02-17)
-------------------

Features:

- Performance improvement: Use ``chain.from_iterable`` in ``_text.py``
to improve runtime and memory usage (:pr:`333`). Thanks :user:`cool-RR` for the PR.

Other changes:

- Remove usage of `ctypes` (:pr:`354`). Thanks :user:`casatir`.

0.16.0 (2020-04-26)
-------------------

Expand Down
25 changes: 6 additions & 19 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ To create a new extension for a part-of-speech tagger, sentiment analyzer, noun
from textblob.base import BaseTagger
class MyTagger(BaseTagger):
def tag(self, text):
pass
# Your implementation goes here
Language Extensions
Expand Down Expand Up @@ -102,7 +104,6 @@ Pull Requests

- If the pull request adds functionality, it is tested and the docs are updated.
- If you've developed an extension, it is on the :ref:`Extensions List <extensions>`.
- The pull request works on Python 2.7, 3.4, 3.5, 3.6, and PyPy. Use ``tox`` to verify that it does.
- You've added yourself to ``AUTHORS.rst``.

4. Submit a pull request to the ``sloria:dev`` branch.
Expand All @@ -112,34 +113,20 @@ Running tests

To run all the tests: ::

$ python run_tests.py
$ pytest

To skip slow tests: ::

$ python run_tests.py fast

To skip tests that require internet: ::

$ python run_tests.py no-internet

To get test coverage reports (must have coverage installed): ::

$ python run_tests.py cover

To run tests on Python 2.7, 3.4, 3.5, and 3.6 virtual environments (must have each interpreter installed): ::

$ tox
$ pytest -m 'not slow'

Documentation
+++++++++++++

Contributions to the documentation are welcome. Documentation is written in `reStructuredText`_ (rST). A quick rST reference can be found `here <https://docutils.sourceforge.io/docs/user/rst/quickref.html>`_. Builds are powered by Sphinx_.

To build docs: ::

$ invoke docs -b
To build docs and run in watch mode: ::

The ``-b`` (for "browse") automatically opens up the docs in your browser after building.
$ tox -e watch-docs

.. _Sphinx: http://sphinx.pocoo.org/

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013-2020 Steven Loria
Copyright Steven Loria and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 369a3eb

Please sign in to comment.