diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9caf3c..7451cf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,55 +17,35 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Conda Bootstrap - uses: goanpeca/setup-miniconda@v1 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 with: - auto-update-conda: true python-version: ${{ matrix.python }} - - name: Conda Config - run: | - conda config --add channels conda-forge - conda config --add channels numba - conda config --set channel_priority strict - conda config --set always_yes yes - conda config --set changeps1 no - conda config --set pip_interop_enabled True - - name: Conda Install - shell: bash -l {0} - run: conda install --yes shellcheck --file=requirements.txt --file=test-requirements.txt - - name: Pip Install - shell: bash -l {0} - run: pip install --no-deps -e .[testing] + - name: Install Poetry Itself + run: pip install poetry + - name: Poetry Install + run: poetry install - name: Flake8 - shell: bash -l {0} - run: flake8 + run: poetry run flake8 - name: Mypy - shell: bash -l {0} - run: mypy . + run: poetry run mypy . - name: Black - shell: bash -l {0} - run: black --check . + run: poetry run black --check . - name: Isort - shell: bash -l {0} - run: isort --recursive --check-only + run: poetry run isort --recursive --check-only - name: Pytest - shell: bash -l {0} - run: pytest + run: poetry run pytest - name: ASV - shell: bash -l {0} run: | - asv --config ./asv_bench/asv.conf.json machine --machine travis --os unknown --arch unknown --cpu unknown --ram unknown - asv --config ./asv_bench/asv.conf.json run --show-stderr --environment existing --quick + poetry run asv --config ./asv_bench/asv.conf.json machine --machine travis --os unknown --arch unknown --cpu unknown --ram unknown + poetry run asv --config ./asv_bench/asv.conf.json run --show-stderr --environment existing --quick - name: Sphinx - shell: bash -l {0} run: | - python setup.py build_sphinx + poetry run python setup.py build_sphinx touch ./docs/_build/html/.nojekyll - - name: Build Wheel - shell: bash -l {0} - run: python setup.py sdist bdist_wheel + - name: Build + run: poetry build - name: Shellcheck - shell: bash -l {0} run: shellcheck scripts/*.sh - name: Preserve Dist uses: actions/upload-artifact@v1 diff --git a/.gitignore b/.gitignore index b407a03..11fea10 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ *.asv/ *.egg-info/ .coverage +.mypy_cache/ .pytest_cache/ .venv/ __pycache__/ build/ coverage.xml +poetry.lock dist/ docs/_build/ docs/_rst/ diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index ba2778d..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[settings] -multi_line_output=3 -include_trailing_comma=True -force_grid_wrap=0 -use_parentheses=True -line_length=88 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6a85fb..39762e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,20 +21,13 @@ tooling. See the "Development Plan" in the README for the generic prioritization ## Development ### Installation -To get started, set up a new virtual environment and install all requirements, either using pip: +To get started, set up a new virtual environment and install all requirements: ```bash virtualenv --python=python3.6 .venv source .venv/bin/activate -pip install -e .[testing] -``` - -or using conda: - -```bash -conda create --name=rle_array shellcheck --file=requirements.txt --file=test-requirements.txt -conda activate rle_array -pip install -e .[testing] +pip install poetry +poetry install ``` ### Code style @@ -48,7 +41,7 @@ To ensure a consistent code style across the code base we're using the following We have a convenience script that runs all these tools and a code style check for you: ```bash -./scripts/fmt.sh +poetry run ./scripts/fmt.sh ``` ### Testing @@ -56,7 +49,7 @@ There are different tools that ensure a well tested and presented library. To ru development), use: ```bash -./scripts/test.sh +poetry run ./scripts/test.sh ``` ### Pytest @@ -64,7 +57,7 @@ We're using [pytest](https://pytest.org) as a testing framework and make heavy u To run the tests simply run: ```bash -pytest +poetry run pytest ``` ### Benchmarks @@ -72,21 +65,21 @@ For performance critical code paths we have [asv](https://asv.readthedocs.io/) b `asv_bench`. To run the benchmarks a single time and receive immediate feedback run ```bash -asv run --python=same --show-stderr +poetry run asv run --python=same --show-stderr ``` ### Documentation Documentation is created using [Sphinx](https://www.sphinx-doc.org/) and can be build by using: ```bash -python setup.py build_sphinx +poetry run python setup.py build_sphinx ``` ### Typing We use [mypy](http://mypy-lang.org/) to check python types. It can be run using: ```bash -mypy . +poetry run mypy . ``` ## Performance Improvements diff --git a/LICENSE.txt b/LICENSE.txt index 29eb624..142cbbf 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 JDA Software, Inc +Copyright (c) 2019-2020 Blue Yonder Group, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 42eb410..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include LICENSE.txt diff --git a/docs/conf.py b/docs/conf.py index 9eaf7a2..cb542a9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,8 +16,8 @@ sys.path.append(os.path.abspath(os.path.join(__location__, "sphinxext"))) add_module_names = False -author = "JDA Software, Inc" -copyright = "2019, JDA Software, Inc" +author = "Blue Yonder Group, Inc" +copyright = "2019-2020, Blue Yonder Group, Inc" project = "rle-array" exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] extensions = [ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5daf3ab --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,51 @@ +[build-system] +requires = [ + "poetry>=0.12", +] +build-backend = "poetry.masonry.api" + +[tool.isort] +profile = "black" + +[tool.poetry] +name = "rle-array" +description = "Run-length encoded pandas." +authors= [ + "Blue Yonder Group, Inc", +] +version = "0.1" +readme = "README.rst" +license = "MIT" +packages = [ + { include = "rle_array" }, +] +repository = "https://github.com/JDASoftwareGroup/rle_array" +keywords = [ + "python", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python", + "Programming Language :: Python :: 3", +] + +[tool.poetry.dependencies] +python = ">=3.6.1,<3.9" +numba = ">=0.45" +numpy = ">=1.17" +pandas = ">=1.0.3,<1.1" + +[tool.poetry.dev-dependencies] +asv = "*" +black = "19.10b0" +flake8-mutable = "1.2.0" +flake8 = "3.8.3" +isort = "5.0.9" +mypy = "*" +pytest = "*" +pytest-cov = "*" +setuptools_scm = "*" +sphinx = "*" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cc34b5e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -numba>=0.45 -numpy>=1.17 -pandas>=1.0.3,<2 diff --git a/scripts/test.sh b/scripts/test.sh index a967997..755511c 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -9,4 +9,3 @@ isort --recursive --check-only flake8 asv --config ./asv_bench/asv.conf.json run --show-stderr --environment existing --quick python setup.py build_sphinx -shellcheck scripts/*.sh diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..fc10107 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +[build_sphinx] +source-dir = docs +build-dir = docs/_build +builder = doctest,html +warning-is-error = true diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 88ee877..dbe9716 --- a/setup.py +++ b/setup.py @@ -1,50 +1,5 @@ -import os -from typing import List - -from setuptools import setup - - -def get_requirements(path: str) -> List[str]: - with open(os.path.join(os.path.dirname(__file__), path)) as fp: - content = fp.read() - return [req for req in content.split("\n") if req != "" and not req.startswith("#")] - - -def setup_package() -> None: - name = "rle_array" - - setup( - name=name, - packages=["rle_array"], - description="Run-length encoded pandas.", - author="JDA Software, Inc", - python_requires=">=3.6", - url="https://github.com/JDASoftwareGroup/rle_array", - license="MIT", - long_description=open("README.rst", "r").read(), - install_requires=get_requirements("requirements.txt"), - tests_require=get_requirements("test-requirements.txt"), - extras_require={"testing": get_requirements("test-requirements.txt")}, - keywords=["python"], - classifiers=[ - "Development Status :: 4 - Beta", - "Environment :: Console", - "Intended Audience :: Developers", - "Natural Language :: English", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - ], - use_scm_version=True, - command_options={ - "build_sphinx": { - "source_dir": ("setup.py", "docs"), - "build_dir": ("setup.py", "docs/_build"), - "builder": ("setup.py", "doctest,html"), - "warning_is_error": ("setup.py", "1"), - } - }, - ) - +#!/usr/bin/env python +import setuptools if __name__ == "__main__": - setup_package() + setuptools.setup() diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 43ac36b..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -asv -black==19.10b0 -flake8-mutable==1.2.0 -flake8==3.8.3 -isort==5.0.9 -mypy -pytest -pytest-cov -setuptools_scm -sphinx