Skip to content

Commit

Permalink
HC-431 - Make hysds-framework conda installable (#35)
Browse files Browse the repository at this point in the history
* added to .gitignore

additional metadata to setup.py

* test github webhook to jenkins

* test github webhook to jenkins

* test github webhook to jenkins

* test github webhook to jenkins

* test

* test

* update

* added new job(s) + workflow to circleci

first job is to build and unit test osaka
second job is to build + publish the package to pypi (added the pypi creds to circleci under contexts)
added workflow first run the "build" job and if successful it will proceed to the publish job to pypi
the workflow will trigger when a new tag is created

* changed pypi repo url

* bump version

* added filter build-and-deploy

* moved pypi-creds context to publish job only

* using cimg docker image

Co-authored-by: dustinlo <[email protected]>
  • Loading branch information
DustinKLo and dustinlo authored Jan 10, 2023
1 parent 981b576 commit 55edbd8
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 5 deletions.
66 changes: 65 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,48 @@ jobs:
source $HOME/.bash_profile
python setup.py install
pytest .
build:
docker:
- image: cimg/python:3.9
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
steps:
- checkout
- run:
name: Install dependencies
command: |
pip install pytest==7.2.0
pip install .
- run:
name: pytest
command: |
pytest .
publish-pypi:
docker:
- image: cimg/python:3.9
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
steps:
- checkout
- run:
name: Init .pypirc
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "repository: https://upload.pypi.org/legacy/" >> ~/.pypirc
echo -e "username: $PYPI_USER" >> ~/.pypirc
echo -e "password: $PYPI_PASSWORD" >> ~/.pypirc
- run:
name: Install tools
command: |
pip install twine==4.0.2
- run:
name: Install and publish to PyPI
command: |
pip install .
python setup.py sdist bdist_wheel
twine upload dist/* --verbose --config-file ~/.pypirc
workflows:
version: 2
Expand All @@ -39,4 +81,26 @@ workflows:
filters:
branches:
only: develop

build-and-deploy:
jobs:
- build:
context:
- docker-hub-creds
- git-oauth-token
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- publish-pypi:
context:
- docker-hub-creds
- git-oauth-token
- pypi-creds
requires:
- build
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,165 @@
*.egg-info
*.pyc
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

2 changes: 1 addition & 1 deletion osaka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from __future__ import division
from __future__ import absolute_import

__version__ = "1.2.0"
__version__ = "1.2.1"
__url__ = "https://github.com/hysds/osaka"
__description__ = "Osaka (Object Store Abstraction K Arcitecture)"
31 changes: 28 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
from setuptools import setup, find_packages
import osaka


def readme():
with open("README.md") as f:
return f.read()


setup(
name="osaka",
version=osaka.__version__,
long_description=osaka.__description__,
description=osaka.__description__,
long_description_content_type="text/markdown",
long_description=readme(),
url=osaka.__url__,
packages=find_packages(),
packages=find_packages(exclude=["tests.*", "tests"]),
include_package_data=True,
zip_safe=False,
install_requires=[
Expand All @@ -27,5 +35,22 @@
"mock>=4.0.3",
"moto>=2.0.6",
],
entry_points={"console_scripts": ["osaka = osaka.__main__:main"]},
entry_points={
"console_scripts": ["osaka = osaka.__main__:main"]
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Operating System :: MacOS :: MacOS X",
],
)

0 comments on commit 55edbd8

Please sign in to comment.