diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 848c186..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.circleci/config.yml b/.circleci/config.yml index e54592b..6471e65 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,79 +1,121 @@ version: 2.1 -commands: - install-packaged-autonormalize: - description: "install autonormalize from source distribution" - steps: - - run : | - source test_env/bin/activate - python setup.py sdist - AUTONORMALIZE_VERSION=$(python setup.py --version) - tar -zxvf "dist/autonormalize-${AUTONORMALIZE_VERSION}.tar.gz" - pip install -e "autonormalize-${AUTONORMALIZE_VERSION}/" - pip install -r "autonormalize-${AUTONORMALIZE_VERSION}/test-requirements.txt" - run-packaged-tests: - description: "run unit tests on packaged testing files" - steps: - - run: | - source test_env/bin/activate - cd "autonormalize-$(python setup.py --version)/" - pytest - -jobs: - "python-27": - working_directory: ~/auto-norm +executors: + python: + parameters: + image_tag: + type: string + default: python:3.7 docker: - - image: circleci/python:2.7 - steps: - - checkout - - run: virtualenv test_env && virtualenv dev_env - - install-packaged-autonormalize - - run: source dev_env/bin/activate && make installdeps - - run: source dev_env/bin/activate && make lint - - run-packaged-tests + - image: circleci/<< parameters.image_tag >> - "python-35": - working_directory: ~/auto-norm - docker: - - image: circleci/python:3.5 +commands: + installation: steps: - checkout - - run: virtualenv test_env && virtualenv dev_env - - install-packaged-autonormalize - - run: source dev_env/bin/activate && make installdeps - - run: source dev_env/bin/activate && make lint - - run-packaged-tests + - run: + name: Installation + command: | + python setup.py sdist + PACKAGE=$(python setup.py --fullname) + tar -zxvf dist/${PACKAGE}.tar.gz + mv ${PACKAGE} package + virtualenv python -q + source python/bin/activate + pip install -e package --progress-bar off + pip install -r package/test-requirements.txt --progress-bar off - "python-36": - working_directory: ~/auto-norm - docker: - - image: circleci/python:3.6 +jobs: + Lint Tests: + parameters: + image_tag: + type: string + default: python:3.7 + executor: + name: python + image_tag: << parameters.image_tag >> steps: - - checkout - - run: virtualenv test_env && virtualenv dev_env - - install-packaged-autonormalize - - run: source dev_env/bin/activate && make installdeps - - run: source dev_env/bin/activate && make lint - - run-packaged-tests + - installation + - run: + name: Lint Tests + command: | + source python/bin/activate + make -C package lint --makefile ../Makefile - "python-37": - working_directory: ~/auto-norm - docker: - - image: circleci/python:3.7 + Unit Tests: + parameters: + image_tag: + type: string + default: python:3.7 + codecov: + type: boolean + default: false + executor: + name: python + image_tag: << parameters.image_tag >> steps: - - checkout - - run: virtualenv test_env && virtualenv dev_env - - install-packaged-autonormalize - - run: source dev_env/bin/activate && make installdeps - - run: source dev_env/bin/activate && make lint - - run-packaged-tests + - installation + - run: + name: Unit Tests + command: | + source python/bin/activate + cd package + pytest autonormalize/ --cov=autonormalize + - when: + condition: << parameters.codecov >> + steps: + - run: + name: Code Coverage + command: | + source python/bin/activate + cd package + codecov + Entry Point Test: + parameters: + image_tag: + type: string + default: python:3.7 + executor: + name: python + image_tag: << parameters.image_tag >> + steps: + - installation + - run: + name: Entry Point Test + command: | + source python/bin/activate + make -C package entry-point-test --makefile ../Makefile workflows: version: 2 - test_all_python_versions: + Integration Tests: jobs: - - "python-27" - - "python-35" - - "python-36" - - "python-37" + - Lint Tests: + name: Py35 - Lint Tests + image_tag: python:3.5 + - Lint Tests: + name: Py36 - Lint Tests + image_tag: python:3.6 + - Lint Tests: + name: Py37 - Lint Tests + image_tag: python:3.7 + - Unit Tests: + name: Py35 - Unit Tests + image_tag: python:3.5 + - Unit Tests: + name: Py36 - Unit Tests + image_tag: python:3.6 + - Unit Tests: + name: Py37 - Unit Tests + image_tag: python:3.7 + codecov: true + - Entry Point Test: + name: Py35 - Entry Point Test + image_tag: python:3.5 + - Entry Point Test: + name: Py36 - Entry Point Test + image_tag: python:3.6 + - Entry Point Test: + name: Py37 - Entry Point Test + image_tag: python:3.7 diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index c63d0e7..0000000 --- a/.github/main.workflow +++ /dev/null @@ -1,12 +0,0 @@ -workflow "Release" { - on = "release" - resolves = ["PyPI"] -} - -action "PyPI" { - uses = "FeatureLabs/gh-action-pypi-upload@master" - secrets = ["PYPI_USERNAME", "PYPI_PASSWORD"] - env = { - TWINE_REPOSITORY_URL = "https://upload.pypi.org/legacy/" - } -} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4c7d2cb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,18 @@ +on: + release: + types: [published] + +name: Release +jobs: + pypi: + name: PyPI Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: PyPI Upload + uses: FeatureLabs/gh-action-pypi-upload@master + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TEST_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a45d83e..cb363bf 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.DS_Store + # IDE .vscode diff --git a/Makefile b/Makefile index 9b37043..8cf7fe5 100755 --- a/Makefile +++ b/Makefile @@ -1,29 +1,22 @@ -.PHONY: clean -clean: - find . -name '*.pyo' -delete - find . -name '*.pyc' -delete - find . -name __pycache__ -delete - find . -name '*~' -delete - -.PHONY: lint -lint: - flake8 autonormalize && isort --check-only --recursive autonormalize +.PHONY: entry-point-test +entry-point-test: + cd ~ && python -c "from featuretools import autonormalize" .PHONY: lint-fix lint-fix: - autopep8 --in-place --recursive --max-line-length=100 --select="E225,E303,E302,E203,E128,E231,E251,E271,E127,E126,E301,W291,W293,E226,E306,E221" autonormalize + select="E225,E303,E302,E203,E128,E231,E251,E271,E127,E126,E301,W291,W293,E226,E306,E221" + autopep8 --in-place --recursive --max-line-length=100 --select=${select} autonormalize isort --recursive autonormalize +.PHONY: lint +lint: + flake8 autonormalize + isort --check-only --recursive autonormalize + .PHONY: test -test: - pytest autonormalize/tests +test: lint + pytest autonormalize/ .PHONY: testcoverage testcoverage: lint - pytest autonormalize/tests --cov=autonormalize - -.PHONY: installdeps -installdeps: - pip install --upgrade pip -q - pip install -e . -q - pip install -r dev-requirements.txt -q \ No newline at end of file + pytest autonormalize/ --cov=autonormalize diff --git a/autonormalize/.DS_Store b/autonormalize/.DS_Store deleted file mode 100644 index fc02052..0000000 Binary files a/autonormalize/.DS_Store and /dev/null differ diff --git a/autonormalize/demos/.DS_Store b/autonormalize/demos/.DS_Store deleted file mode 100644 index 8b566e4..0000000 Binary files a/autonormalize/demos/.DS_Store and /dev/null differ diff --git a/autonormalize/examples/.DS_Store b/autonormalize/examples/.DS_Store deleted file mode 100644 index 8617686..0000000 Binary files a/autonormalize/examples/.DS_Store and /dev/null differ diff --git a/autonormalize/tests/.DS_Store b/autonormalize/tests/.DS_Store deleted file mode 100644 index 517d89d..0000000 Binary files a/autonormalize/tests/.DS_Store and /dev/null differ diff --git a/autonormalize/tests/test_example.py b/autonormalize/tests/test_example.py index 4496fc2..14e95bf 100644 --- a/autonormalize/tests/test_example.py +++ b/autonormalize/tests/test_example.py @@ -14,7 +14,7 @@ def test_ft_mock_customer(): entityset = an.auto_entityset(df, name="Customer Transactions", time_index='transaction_time') assert set(entityset['transaction_id'].df.columns) == set(['transaction_id', 'session_id', 'transaction_time', - 'product_id', 'amount']) + 'product_id', 'amount']) assert set(entityset['product_id'].df.columns) == set(['product_id', 'brand']) diff --git a/autonormalize/tests/test_normalize.py b/autonormalize/tests/test_normalize.py index 6007035..cea2f00 100644 --- a/autonormalize/tests/test_normalize.py +++ b/autonormalize/tests/test_normalize.py @@ -128,7 +128,7 @@ def test_normalize_dataframe(): assert len(new_dfs) == 3 dic_one = {'team': ['Red', 'Red', 'Red', 'Orange', 'Orange', 'Yellow', - 'Yellow', 'Green', 'Green', 'Blue'], + 'Yellow', 'Green', 'Green', 'Blue'], 'jersey_num': [1, 2, 3, 1, 2, 1, 5, 8, 2, 2], 'player_name': ['A', 'B', 'C', 'D', 'A', 'E', 'B', 'A', 'G', 'H']} diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100755 index 745e663..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ --r test-requirements.txt -codecov==2.0.15 -flake8==3.7.0 -autopep8==1.4.3 -isort==4.3.4 diff --git a/docs/.DS_Store b/docs/.DS_Store deleted file mode 100644 index 7de8021..0000000 Binary files a/docs/.DS_Store and /dev/null differ diff --git a/requirements.txt b/requirements.txt index 9e70e6f..6db33ce 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ +featuretools>=0.4.0 numpy>=1.13.3 pandas>=0.23.0 -tqdm>=4.19.2 -featuretools>=0.0.0 \ No newline at end of file +python-dateutil>=2.6.1,<2.8.1 +tqdm>=4.19.2 \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 4efa87f..0283030 100755 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,7 @@ +autopep8==1.4.3 +codecov==2.0.15 +flake8==3.7.0 +isort==4.3.4 pytest==4.4.1 -pytest-xdist==1.26.1 pytest-cov==2.6.1 +pytest-xdist==1.26.1 \ No newline at end of file