From d77809a322654cb90f3cdae2869a3793281901aa Mon Sep 17 00:00:00 2001 From: dianelee217 Date: Wed, 24 Feb 2021 12:09:53 -0500 Subject: [PATCH 1/2] versioning and publishing workflow add contributor readme button removing badge temporarily lowercase --- .github/workflows/publish-package.yml | 27 +++++++++++++ .github/workflows/test-package.yml | 4 +- README.md | 2 +- rubicon/__init__.py | 3 +- rubicon/version.py | 11 ++++++ setup.py | 31 +++++++++++++-- version.py | 56 --------------------------- 7 files changed, 70 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/publish-package.yml create mode 100644 rubicon/version.py delete mode 100644 version.py diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 00000000..d24f48ea --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,27 @@ +name: Publish python package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + TWINE_REPOSITORY: pypi + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 35bafe0c..c02aa5ae 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -2,7 +2,7 @@ # executes the package tests. # # For more details: https://docs.github.com/en/actions/guides/building-and-testing-python -name: Python package using conda +name: Tests on: pull_request: @@ -38,4 +38,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest \ No newline at end of file + pytest diff --git a/README.md b/README.md index fa1ea270..c68d1651 100644 --- a/README.md +++ b/README.md @@ -141,4 +141,4 @@ code format throughout the project. You can format without committing via
Ryan Soley


Diane Lee

- \ No newline at end of file + diff --git a/rubicon/__init__.py b/rubicon/__init__.py index 8ed88755..f5f39156 100644 --- a/rubicon/__init__.py +++ b/rubicon/__init__.py @@ -9,7 +9,8 @@ Rubicon, ) -__version__ = "4.5.0" +from .version import __version__ + __all__ = [ "Artifact", "Dataframe", diff --git a/rubicon/version.py b/rubicon/version.py new file mode 100644 index 00000000..053a63cd --- /dev/null +++ b/rubicon/version.py @@ -0,0 +1,11 @@ +""" +File containers the version number for the package +""" + +MAJOR = 0 +MINOR = 1 +MICRO = 0 + +VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) + +__version__ = VERSION diff --git a/setup.py b/setup.py index c672c40d..5f1d019f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -from version import get_version +from rubicon.version import __version__ install_requires = [ "click>=7.1", @@ -25,9 +25,9 @@ setup( name="rubicon", - version=get_version(), - author="The Rubicon Team", - author_email="rubicon-developers@capitalone.com", + version=__version__, + author="Joe Wolfe, Ryan Soley, Diane Lee, Mike McCarty, CapitalOne", + license='Apache License, Version 2.0', description="an ML library for model development and governance", packages=find_packages(), include_package_data=True, @@ -41,4 +41,27 @@ "rubicon_experiment = rubicon.intake_rubicon.experiment:ExperimentSource", ], }, + classifiers=[ + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + 'Development Status :: 4 - Beta', + + # Indicate who your project is intended for + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'Topic :: Software Development :: Build Tools', + 'Topic :: Software Development :: Documentation', + + # Pick your license as you wish (should match "license" above) + 'License :: OSI Approved :: Apache Software License', + + # Specify the Python versions you support here. In particular, ensure + # that you indicate whether you support Python 3 or both. + 'Programming Language :: Python :: 3', + ], ) diff --git a/version.py b/version.py deleted file mode 100644 index 540141ab..00000000 --- a/version.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -Starting point taken from https://gist.github.com/pwithnall/7bc5f320b3bdf418265a - -Gets the current version number. -If in a git repository, it is the current git tag. -To use this script, simply import it in your setup.py file -and use the results of get_version() as your package version: - from version import * - setup( - ... - version=get_version(), - ... - ) -""" - -__all__ = "get_version" - -import os -import subprocess -from os.path import dirname, isdir, join - -tag = os.environ.get("COMMIT_MESSAGE") - - -def get_version(): - # tag gets specified during the Jenkins pipeline - if tag: - return tag - - # if no tag, pull from the latest github tag - d = dirname(__file__) - - if isdir(join(d, "..", "..", ".git")): - # Get the version using "git describe". - cmd = "git describe --tags".split() - try: - version = subprocess.check_output(cmd).decode().strip() - except subprocess.CalledProcessError: - print("Unable to find .git directory") - # default so that jenkins doesn't break - version = "non-master-branch" - - # PEP 386 compatibility - if "-" in version: - version = ".post".join(version.split("-")[:2]) - - else: - print("Unable to find .git directory") - # default so that jenkins doesn't break - version = "non-master-branch" - - return version - - -if __name__ == "__main__": - print(get_version()) From 987b4a9db8a6cdaaa2bb4cb895b2f055526ecaa3 Mon Sep 17 00:00:00 2001 From: dianelee217 Date: Wed, 24 Feb 2021 14:24:54 -0500 Subject: [PATCH 2/2] hardcode version --- rubicon/__init__.py | 2 +- rubicon/version.py | 11 ----------- setup.py | 4 +--- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 rubicon/version.py diff --git a/rubicon/__init__.py b/rubicon/__init__.py index f5f39156..5a2920dd 100644 --- a/rubicon/__init__.py +++ b/rubicon/__init__.py @@ -9,7 +9,7 @@ Rubicon, ) -from .version import __version__ +__version__ = "0.1.0" __all__ = [ "Artifact", diff --git a/rubicon/version.py b/rubicon/version.py deleted file mode 100644 index 053a63cd..00000000 --- a/rubicon/version.py +++ /dev/null @@ -1,11 +0,0 @@ -""" -File containers the version number for the package -""" - -MAJOR = 0 -MINOR = 1 -MICRO = 0 - -VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) - -__version__ = VERSION diff --git a/setup.py b/setup.py index 5f1d019f..89d4bea7 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ from setuptools import find_packages, setup -from rubicon.version import __version__ - install_requires = [ "click>=7.1", "dask[dataframe]>=2.12.0", @@ -25,7 +23,7 @@ setup( name="rubicon", - version=__version__, + version="0.1.0", author="Joe Wolfe, Ryan Soley, Diane Lee, Mike McCarty, CapitalOne", license='Apache License, Version 2.0', description="an ML library for model development and governance",