Skip to content

Commit e56f09c

Browse files
Merge pull request #20 from JDASoftwareGroup/poetry
Poetry
2 parents 5e2251b + 70c9552 commit e56f09c

File tree

13 files changed

+89
-124
lines changed

13 files changed

+89
-124
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,35 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v2
20-
- name: Conda Bootstrap
21-
uses: goanpeca/setup-miniconda@v1
20+
- name: Set up Python ${{ matrix.python }}
21+
uses: actions/setup-python@v2
2222
with:
23-
auto-update-conda: true
2423
python-version: ${{ matrix.python }}
25-
- name: Conda Config
26-
run: |
27-
conda config --add channels conda-forge
28-
conda config --add channels numba
29-
conda config --set channel_priority strict
30-
conda config --set always_yes yes
31-
conda config --set changeps1 no
32-
conda config --set pip_interop_enabled True
33-
- name: Conda Install
34-
shell: bash -l {0}
35-
run: conda install --yes shellcheck --file=requirements.txt --file=test-requirements.txt
36-
- name: Pip Install
37-
shell: bash -l {0}
38-
run: pip install --no-deps -e .[testing]
24+
- name: Install Poetry Itself
25+
run: pip install poetry
26+
- name: Poetry Install
27+
run: poetry install
3928
- name: Flake8
40-
shell: bash -l {0}
41-
run: flake8
29+
run: poetry run flake8
4230
- name: Mypy
43-
shell: bash -l {0}
44-
run: mypy .
31+
run: poetry run mypy .
4532
- name: Black
46-
shell: bash -l {0}
47-
run: black --check .
33+
run: poetry run black --check .
4834
- name: Isort
49-
shell: bash -l {0}
50-
run: isort --recursive --check-only
35+
run: poetry run isort --recursive --check-only
5136
- name: Pytest
52-
shell: bash -l {0}
53-
run: pytest
37+
run: poetry run pytest
5438
- name: ASV
55-
shell: bash -l {0}
5639
run: |
57-
asv --config ./asv_bench/asv.conf.json machine --machine travis --os unknown --arch unknown --cpu unknown --ram unknown
58-
asv --config ./asv_bench/asv.conf.json run --show-stderr --environment existing --quick
40+
poetry run asv --config ./asv_bench/asv.conf.json machine --machine travis --os unknown --arch unknown --cpu unknown --ram unknown
41+
poetry run asv --config ./asv_bench/asv.conf.json run --show-stderr --environment existing --quick
5942
- name: Sphinx
60-
shell: bash -l {0}
6143
run: |
62-
python setup.py build_sphinx
44+
poetry run python setup.py build_sphinx
6345
touch ./docs/_build/html/.nojekyll
64-
- name: Build Wheel
65-
shell: bash -l {0}
66-
run: python setup.py sdist bdist_wheel
46+
- name: Build
47+
run: poetry build
6748
- name: Shellcheck
68-
shell: bash -l {0}
6949
run: shellcheck scripts/*.sh
7050
- name: Preserve Dist
7151
uses: actions/upload-artifact@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
*.asv/
22
*.egg-info/
33
.coverage
4+
.mypy_cache/
45
.pytest_cache/
56
.venv/
67
__pycache__/
78
build/
89
coverage.xml
10+
poetry.lock
911
dist/
1012
docs/_build/
1113
docs/_rst/

.isort.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,13 @@ tooling. See the "Development Plan" in the README for the generic prioritization
2121
## Development
2222

2323
### Installation
24-
To get started, set up a new virtual environment and install all requirements, either using pip:
24+
To get started, set up a new virtual environment and install all requirements:
2525

2626
```bash
2727
virtualenv --python=python3.6 .venv
2828
source .venv/bin/activate
29-
pip install -e .[testing]
30-
```
31-
32-
or using conda:
33-
34-
```bash
35-
conda create --name=rle_array shellcheck --file=requirements.txt --file=test-requirements.txt
36-
conda activate rle_array
37-
pip install -e .[testing]
29+
pip install poetry
30+
poetry install
3831
```
3932

4033
### Code style
@@ -48,45 +41,45 @@ To ensure a consistent code style across the code base we're using the following
4841
We have a convenience script that runs all these tools and a code style check for you:
4942

5043
```bash
51-
./scripts/fmt.sh
44+
poetry run ./scripts/fmt.sh
5245
```
5346

5447
### Testing
5548
There are different tools that ensure a well tested and presented library. To run them all at once (useful for
5649
development), use:
5750

5851
```bash
59-
./scripts/test.sh
52+
poetry run ./scripts/test.sh
6053
```
6154

6255
### Pytest
6356
We're using [pytest](https://pytest.org) as a testing framework and make heavy use of `fixtures` and `parametrization`.
6457
To run the tests simply run:
6558

6659
```bash
67-
pytest
60+
poetry run pytest
6861
```
6962

7063
### Benchmarks
7164
For performance critical code paths we have [asv](https://asv.readthedocs.io/) benchmarks in place in the subfolder
7265
`asv_bench`. To run the benchmarks a single time and receive immediate feedback run
7366

7467
```bash
75-
asv run --python=same --show-stderr
68+
poetry run asv run --python=same --show-stderr
7669
```
7770

7871
### Documentation
7972
Documentation is created using [Sphinx](https://www.sphinx-doc.org/) and can be build by using:
8073

8174
```bash
82-
python setup.py build_sphinx
75+
poetry run python setup.py build_sphinx
8376
```
8477

8578
### Typing
8679
We use [mypy](http://mypy-lang.org/) to check python types. It can be run using:
8780

8881
```bash
89-
mypy .
82+
poetry run mypy .
9083
```
9184

9285
## Performance Improvements

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 JDA Software, Inc
3+
Copyright (c) 2019-2020 Blue Yonder Group, Inc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
sys.path.append(os.path.abspath(os.path.join(__location__, "sphinxext")))
1717

1818
add_module_names = False
19-
author = "JDA Software, Inc"
20-
copyright = "2019, JDA Software, Inc"
19+
author = "Blue Yonder Group, Inc"
20+
copyright = "2019-2020, Blue Yonder Group, Inc"
2121
project = "rle-array"
2222
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
2323
extensions = [

pyproject.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[build-system]
2+
requires = [
3+
"poetry>=0.12",
4+
]
5+
build-backend = "poetry.masonry.api"
6+
7+
[tool.isort]
8+
profile = "black"
9+
10+
[tool.poetry]
11+
name = "rle-array"
12+
description = "Run-length encoded pandas."
13+
authors= [
14+
"Blue Yonder Group, Inc",
15+
]
16+
version = "0.1"
17+
readme = "README.rst"
18+
license = "MIT"
19+
packages = [
20+
{ include = "rle_array" },
21+
]
22+
repository = "https://github.com/JDASoftwareGroup/rle_array"
23+
keywords = [
24+
"python",
25+
]
26+
classifiers = [
27+
"Development Status :: 4 - Beta",
28+
"Environment :: Console",
29+
"Intended Audience :: Developers",
30+
"Natural Language :: English",
31+
"Programming Language :: Python",
32+
"Programming Language :: Python :: 3",
33+
]
34+
35+
[tool.poetry.dependencies]
36+
python = ">=3.6.1,<3.9"
37+
numba = ">=0.45"
38+
numpy = ">=1.17"
39+
pandas = ">=1.0.3,<1.1"
40+
41+
[tool.poetry.dev-dependencies]
42+
asv = "*"
43+
black = "19.10b0"
44+
flake8-mutable = "1.2.0"
45+
flake8 = "3.8.3"
46+
isort = "5.0.9"
47+
mypy = "*"
48+
pytest = "*"
49+
pytest-cov = "*"
50+
setuptools_scm = "*"
51+
sphinx = "*"

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ isort --recursive --check-only
99
flake8
1010
asv --config ./asv_bench/asv.conf.json run --show-stderr --environment existing --quick
1111
python setup.py build_sphinx
12-
shellcheck scripts/*.sh

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build_sphinx]
2+
source-dir = docs
3+
build-dir = docs/_build
4+
builder = doctest,html
5+
warning-is-error = true

setup.py

100644100755
Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,5 @@
1-
import os
2-
from typing import List
3-
4-
from setuptools import setup
5-
6-
7-
def get_requirements(path: str) -> List[str]:
8-
with open(os.path.join(os.path.dirname(__file__), path)) as fp:
9-
content = fp.read()
10-
return [req for req in content.split("\n") if req != "" and not req.startswith("#")]
11-
12-
13-
def setup_package() -> None:
14-
name = "rle_array"
15-
16-
setup(
17-
name=name,
18-
packages=["rle_array"],
19-
description="Run-length encoded pandas.",
20-
author="JDA Software, Inc",
21-
python_requires=">=3.6",
22-
url="https://github.com/JDASoftwareGroup/rle_array",
23-
license="MIT",
24-
long_description=open("README.rst", "r").read(),
25-
install_requires=get_requirements("requirements.txt"),
26-
tests_require=get_requirements("test-requirements.txt"),
27-
extras_require={"testing": get_requirements("test-requirements.txt")},
28-
keywords=["python"],
29-
classifiers=[
30-
"Development Status :: 4 - Beta",
31-
"Environment :: Console",
32-
"Intended Audience :: Developers",
33-
"Natural Language :: English",
34-
"Programming Language :: Python",
35-
"Programming Language :: Python :: 3",
36-
],
37-
use_scm_version=True,
38-
command_options={
39-
"build_sphinx": {
40-
"source_dir": ("setup.py", "docs"),
41-
"build_dir": ("setup.py", "docs/_build"),
42-
"builder": ("setup.py", "doctest,html"),
43-
"warning_is_error": ("setup.py", "1"),
44-
}
45-
},
46-
)
47-
1+
#!/usr/bin/env python
2+
import setuptools
483

494
if __name__ == "__main__":
50-
setup_package()
5+
setuptools.setup()

test-requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)