From b9189e717727a9932436e4d9b5b97b670f236280 Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 19:47:53 +1000 Subject: [PATCH 1/9] Use flit for build --- .travis.yml | 4 ++-- README.rst | 13 ++++++++----- pyproject.toml | 29 +++++++++++++++++++++++++++++ text2array/__init__.py | 3 ++- 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 pyproject.toml diff --git a/.travis.yml b/.travis.yml index e8ba685..ee42ac1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ python: - 3.6 - 3.7 install: - - pip install -r requirements-test.txt - - pip install -e . + - pip install flit + - flit install --symlink --deps test script: pytest after_success: - pip install coveralls diff --git a/README.rst b/README.rst index 9a4a89f..740407a 100644 --- a/README.rst +++ b/README.rst @@ -43,19 +43,19 @@ https://text2array.readthedocs.io Contributing ============ -Pull requests are welcome! To start contributing, make sure to install all the dependencies. +Pull requests are welcome! To start contributing, first install flit_. :: - pip install -r requirements.txt + pip install flit -Then install this library as editable package. +Next, install this library and its dependencies in development mode. :: - pip install -e . + flit install --symlink -Next, setup the pre-commit hook. +Lastly, setup the pre-commit hook. :: @@ -68,3 +68,6 @@ License ======= Apache License, Version 2.0 + + +_flit: https://pypi.org/project/flit/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3a91c3a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["flit"] +build-backend = "flit.buildapi" + +[tool.flit.metadata] +module = "text2array" +author = "Kemal Kurniawan" +author-email = "kemal@kkurniawan.com" +home-page = "https://github.com/kmkurn/text2array" +requires = ["numpy", "tqdm"] +requires-python = "~=3.6" +description-file = "README.rst" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Scientific/Engineering :: Artificial Intelligence", +] + +[tool.flit.metadata.requires-extra] +test = ["pytest ~=4.1.1", "pytest-cov"] +doc = ["Sphinx ~=1.8.3"] +dev = ["flake8", "flake8-mypy", "yapf"] + +[tool.flit.metadata.urls] +Documentation = "https://text2array.readthedocs.io" diff --git a/text2array/__init__.py b/text2array/__init__.py index 96579ea..ddf68c1 100644 --- a/text2array/__init__.py +++ b/text2array/__init__.py @@ -11,7 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +"""Convert your NLP text data to arrays!""" +__version__ = '0.0.9' __all__ = [ 'Sample', 'Batch', @@ -19,7 +21,6 @@ 'BatchIterator', 'ShuffleIterator', ] -__version__ = '0.0.9' from .batches import Batch from .samples import Sample From 4764a82676b1ce1f451be344bf7d6e5abe5c500d Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 19:50:26 +1000 Subject: [PATCH 2/9] Fix flit install command in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ee42ac1..ed16768 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - 3.7 install: - pip install flit - - flit install --symlink --deps test + - flit install --symlink --extras test script: pytest after_success: - pip install coveralls From 3d101c295fb75d73923d7398b8fb2dfde1a014fd Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 19:55:37 +1000 Subject: [PATCH 3/9] Remove --extras option from flit install in .travis.yml Because it installs all dependencies anyway; there is no way to install only core and test dependencies. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ed16768..e2b0850 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - 3.7 install: - pip install flit - - flit install --symlink --extras test + - flit install --symlink script: pytest after_success: - pip install coveralls From 22ca019704d9cdd69e6d201e0b108e33acfa10ff Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 20:02:17 +1000 Subject: [PATCH 4/9] Bump to alpha release v0.0.10a1 --- text2array/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text2array/__init__.py b/text2array/__init__.py index ddf68c1..b3e5278 100644 --- a/text2array/__init__.py +++ b/text2array/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. """Convert your NLP text data to arrays!""" -__version__ = '0.0.9' +__version__ = '0.0.10a1' __all__ = [ 'Sample', 'Batch', From 72c32cacd1a17b498da2ca7f8fc6db0af68b4859 Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 20:04:25 +1000 Subject: [PATCH 5/9] Fix external hyperlink in README.rst [skip ci] --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 740407a..4f059aa 100644 --- a/README.rst +++ b/README.rst @@ -70,4 +70,4 @@ License Apache License, Version 2.0 -_flit: https://pypi.org/project/flit/ +.. _flit: https://pypi.org/project/flit/ From b655596e0827f438b45c7094b7887cc01f8a45ad Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 20:12:07 +1000 Subject: [PATCH 6/9] Fix python specification in pyproject.toml Because using tilde makes flit fail in detecting supported python version when building wheels. See https://github.com/takluyver/flit/issues/261 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3a91c3a..0fcb5b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ author = "Kemal Kurniawan" author-email = "kemal@kkurniawan.com" home-page = "https://github.com/kmkurn/text2array" requires = ["numpy", "tqdm"] -requires-python = "~=3.6" +requires-python = ">=3.6,<4" description-file = "README.rst" classifiers = [ "Development Status :: 3 - Alpha", From f6bdb31ad05422e1566e8a6f0391721632147485 Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 20:14:05 +1000 Subject: [PATCH 7/9] Bump to alpha release v0.0.10a2 [skip ci] --- text2array/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text2array/__init__.py b/text2array/__init__.py index b3e5278..3ab33ea 100644 --- a/text2array/__init__.py +++ b/text2array/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. """Convert your NLP text data to arrays!""" -__version__ = '0.0.10a1' +__version__ = '0.0.10a2' __all__ = [ 'Sample', 'Batch', From 0a05bf22dafa30b9bb49542772eccfcd99f711c1 Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 20:18:24 +1000 Subject: [PATCH 8/9] Remove unused setuptools-related files --- requirements-test.txt | 4 ---- requirements.txt | 4 ---- setup.py | 36 ------------------------------------ 3 files changed, 44 deletions(-) delete mode 100644 requirements-test.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index 6855cff..0000000 --- a/requirements-test.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy==1.16.0 -pytest==4.1.1 -pytest-cov==2.6.1 -tqdm==4.31.1 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b3e1ce5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ --r requirements-test.txt -flake8==3.6.0 -flake8-mypy==17.8.0 -yapf==0.25.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 4f32869..0000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -from pathlib import Path -from setuptools import setup, find_packages -import re - -here = Path(__file__).resolve().parent -readme = (here / 'README.rst').read_text() -version = re.search( - r'__version__ = (["\'])([^"\']*)\1', - (here / 'text2array' / '__init__.py').read_text(), -)[2] - -setup( - name='text2array', - version=version, - description='Convert your NLP text data to arrays!', - long_description=readme, - url='https://github.com/kmkurn/text2array', - author='Kemal Kurniawan', - author_email='kemal@kkurniawan.com', - license='Apache', - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ], - packages=find_packages(), - install_requires=[ - 'numpy', - 'tqdm ~=4.31.1', - ], - python_requires='>=3.6, <4', -) From a2b03738914e47447a8537c509193ad195915aa3 Mon Sep 17 00:00:00 2001 From: Kemal Kurniawan Date: Sun, 29 Sep 2019 20:28:57 +1000 Subject: [PATCH 9/9] Add complete doc extra to pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0fcb5b9..a58b6ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ [tool.flit.metadata.requires-extra] test = ["pytest ~=4.1.1", "pytest-cov"] -doc = ["Sphinx ~=1.8.3"] +doc = ["Sphinx ~=1.8.3", "sphinx_rtd_theme", "sphinx-autodoc-typehints ~=1.6.0"] dev = ["flake8", "flake8-mypy", "yapf"] [tool.flit.metadata.urls]