diff --git a/.travis.yml b/.travis.yml index e8ba685..e2b0850 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 script: pytest after_success: - pip install coveralls diff --git a/README.rst b/README.rst index 9a4a89f..4f059aa 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..a58b6ce --- /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,<4" +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", "sphinx_rtd_theme", "sphinx-autodoc-typehints ~=1.6.0"] +dev = ["flake8", "flake8-mypy", "yapf"] + +[tool.flit.metadata.urls] +Documentation = "https://text2array.readthedocs.io" 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', -) diff --git a/text2array/__init__.py b/text2array/__init__.py index 96579ea..3ab33ea 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.10a2' __all__ = [ 'Sample', 'Batch', @@ -19,7 +21,6 @@ 'BatchIterator', 'ShuffleIterator', ] -__version__ = '0.0.9' from .batches import Batch from .samples import Sample