From 5403bc8a8b340747ce8de9df20993f5d1eb345a1 Mon Sep 17 00:00:00 2001 From: Anurag Kumar Mishra Date: Sat, 26 Sep 2020 00:31:16 +0530 Subject: [PATCH] Added v0.1.5 (#4) * Added fix as per #3 * Configured circleci for building and publishing * Added v0.1.5 --- .circleci/config.yml | 89 +++++++++++++++++++ setup.py | 13 ++- {tests => test}/.gitkeep | 0 test/__init__.py | 0 .../test_pycorrcat.py | 0 5 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 .circleci/config.yml rename {tests => test}/.gitkeep (100%) create mode 100644 test/__init__.py rename tests/pycorrcat_test.py => test/test_pycorrcat.py (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a5b409b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,89 @@ +# Defined anchors for re-usable components +references: + restore_cache: &restore_cache + restore_cache: + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} + install_dependencies: &install_dependencies + run: + name: Install Python deps in a venv + command: | + python3 -m venv venv + . venv/bin/activate + python3 -m pip install --upgrade pip + pip install -r requirements.txt + pip install setuptools wheel twine + save_cache: &save_cache + save_cache: + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} + paths: + - "venv" + run_unittests: &run_unittests + run: + name: Run unittests + command: | + . venv/bin/activate + python3 -m unittest discover + init_pypirc: &init_pypirc + run: + name: init .pypirc + command: | + echo -e "[pypi]" >> ~/.pypirc + echo -e "username = __token__" >> ~/.pypirc + echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + build_publish: &build_publish + run: + name: Build and publish + command: | + . venv/bin/activate + python3 setup.py sdist bdist_wheel + python3 -m twine upload dist/* + + +# Actual jobs +version: 2 +jobs: + test_all: + working_directory: ~/pycorr + docker: + - image: circleci/python:3.7.1-stretch + steps: + - checkout + - <<: *restore_cache + - <<: *install_dependencies + - <<: *save_cache + - <<: *run_unittests + + pypi_publish: + working_directory: ~/pycorr + docker: + - image: circleci/python:3.7.1-stretch + steps: + - checkout + - <<: *restore_cache + - <<: *install_dependencies + - <<: *save_cache + - <<: *run_unittests + - <<: *init_pypirc + - <<: *build_publish + +# defined workflows +workflows: + version: 2 + test_dev: + jobs: + - test_all: + filters: + branches: + only: + - develop + publish_master: + jobs: + - pypi_publish: + filters: + branches: + only: + - master + + + + diff --git a/setup.py b/setup.py index 55bf7b5..b6b47de 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,22 @@ # -*- coding: utf-8 -*- -from os import path + +import os +import sys from pip._internal.req import parse_requirements from setuptools import find_packages, setup +from setuptools.command.install import install + +VERSION = "0.1.5" -this_directory = path.abspath(path.dirname(__file__)) -with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: +this_directory = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="pycorr", - version="0.1.4", + version=VERSION, description="Python package for calculating correlation amongst categorical variables", long_description_content_type="text/markdown", long_description=long_description, diff --git a/tests/.gitkeep b/test/.gitkeep similarity index 100% rename from tests/.gitkeep rename to test/.gitkeep diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/pycorrcat_test.py b/test/test_pycorrcat.py similarity index 100% rename from tests/pycorrcat_test.py rename to test/test_pycorrcat.py