Skip to content

Commit

Permalink
Merge pull request #90 from svedel/staging
Browse files Browse the repository at this point in the history
Create first release on PyPI
  • Loading branch information
svedel authored Jul 15, 2021
2 parents e7ca701 + c790e99 commit 67df9c7
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 17 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/prod.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# deployment workflow to PyPI

name: Publish python package greattunes to PyPI

on:
push:
branches:
- master

jobs:
build-n-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install build dependencies
run: |
pip install --upgrade setuptools wheel
pip install --upgrade -r requirements.txt
- name: Build package
run: python3 setup.py bdist_wheel
- name: Publish distribution of greattunes to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/staging.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install build dependencies
run: |
pip install --upgrade setuptools wheel
pip install --upgrade -r requirements.txt
- name: Build package
run: python3 setup.py bdist_wheel
- name: Publish distribution of greattunes to TestPyPI
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yml → .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CI/CD pipeline
# Pipeline for testing, code format and style checks

name: CI CD workflow
name: Tests, code format and style checks

on:
push:
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased] -

Version for this release: 0.0.4
Version for this release: 0.0.5

### Added
### Changed
### Deprecated
### Removed
### Fixed

## [0.0.4] - July 14, 2021

### Added
* Functionality to use integer and categorical covariates as input to the function under optimization, using the method
Expand Down Expand Up @@ -43,6 +51,7 @@ user-facing format (in `pandas` df) to report all entries, including integer and
data types (`int` and `str`).

### Fixed
None

## [0.0.3] - February 25, 2021

Expand Down
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,22 @@ A short primer on Bayesian optimization is provided in [this section](#a-primer-

## Installation

### First install `torch` dependencies
### Via `pip`

**Installing `torch` dependencies is a requirement.** Unfortunately `torch`-libraries have to be installed outside
normal bulk `pip install -r requirements.txt`.
The library is available on [https://pypi.org/](https://pypi.org/), so to install simply run
```python
pip install greattunes
```

### From source

You can also download the library source code and install it from there.

#### First install `torch` dependencies

**Installing `torch` dependencies is not always a requirement.** Unfortunately, in some cases `torch`-libraries have to
be installed outside normal bulk `pip install -r requirements.txt`. **First try to install directly via steps 1-3 in
[Install library](#Install-library) below, and only install `torch` libraries manually if direct installation fails.**

To find the right installation command for `torch`, use [this link](https://pytorch.org/get-started/locally/)
to determine the details and add as a separate command in the `github` actions yaml. As an example, the following is the
Expand All @@ -73,22 +85,18 @@ pip install --upgrade setuptools wheel
2. Clone this repo
3. Do local installation
```python
python -m pip install <path_to_repo>/kre8_core/
python -m pip install https://github.com/svedel/greattunes/
```

Step 3 will install by running `kre8_core/setup.py` locally and installing. This step can also be broken into two,
Step 3 will install by running `greattunes/setup.py` locally and installing. This step can also be broken into two,
which might improve debugging
```python
python3 <path_to_repo>/kre8_core/ setup.py bdist_wheel
python -m pip install <path_to_repo>/kre8_core/dist/creative_project-<version>-py3-none-any.whl
python3 https://github.com/svedel/greattunes/ setup.py bdist_wheel
python -m pip install https://github.com/svedel/greattunes/dist/greattunes-<version>-py3-none-any.whl
```
where `<version>` is the latest version in normal `python` format of `MAJOR.MINOR[.MICRO]`
(check `/dist`-folder to see which one to pick).

#### Uploading build to repo servers (e.g. `PyPI`)

To be investigated. Here's [a link with help](https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python) on how to leverage `GitHub actions` for this purpose.

## Using the framework

All capabilities of the framework are described below.
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ def req_extend(requirements, target_str, extend_str):
# dependency_links=["https://download.pytorch.org/whl/torch_stable.html"],
install_requires=requirements,
classifiers=[
"Framework :: Torch",
"Framework :: BOTorch",
"Framework :: GPyTorch",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
Expand Down

0 comments on commit 67df9c7

Please sign in to comment.