Skip to content

Commit e30036f

Browse files
authored
Merge pull request #21 from VowpalWabbit/release_to_pypi
add pypi release workflow and fixes
2 parents 029114b + 9a71ade commit e30036f

File tree

7 files changed

+53
-8
lines changed

7 files changed

+53
-8
lines changed

.github/workflows/pypi_release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: pypi-release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
strategy:
10+
matrix:
11+
os: ['ubuntu-latest']
12+
python-version: [3.10]
13+
14+
runs-on: ${{ matrix.os }}
15+
environment:
16+
name: Release-PyPi
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Build
22+
run: |
23+
pip install twine
24+
python setup.py sdist bdist_wheel
25+
26+
- name: Check wheels
27+
run: twine check dist/*
28+
29+
- name: Upload to TestPyPi
30+
uses: pypa/gh-action-pypi-publish@v1.6.4
31+
with:
32+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
33+
repository_url: https://test.pypi.org/legacy/
34+
35+
- name: Upload to PyPi
36+
uses: pypa/gh-action-pypi-publish@v1.6.4
37+
with:
38+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The beauty of `learn_to_pick` is its flexibility. Whether you're a fan of Vowpal
3333

3434
## Installation
3535

36-
`pip install .`
36+
`pip install learn-to-pick`
3737

3838
## Basic Usage
3939

notebooks/news_recommendation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"outputs": [],
9797
"source": [
9898
"picker = learn_to_pick.PickBest.create(metrics_step=20, metrics_window_size=20, selection_scorer=CustomSelectionScorer())\n",
99-
"random_picker = learn_to_pick.PickBest.create(metrics_step=20, metrics_window_size=20, policy=learn_to_pick.PickBestRandomPolicy, selection_scorer=CustomSelectionScorer())"
99+
"random_picker = learn_to_pick.PickBest.create(metrics_step=20, metrics_window_size=20, policy=learn_to_pick.PickBestRandomPolicy(), selection_scorer=CustomSelectionScorer())"
100100
]
101101
},
102102
{

notebooks/prompt_variable_injection.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
" preference = learn_to_pick.BasedOn([\"Vegetarian\", \"regular dairy is ok\"]),\n",
127127
")\n",
128128
"\n",
129-
"picked_meal = response[\"picked\"][0][\"meal\"]"
129+
"picked_meal = response[\"picked\"][\"meal\"]"
130130
]
131131
},
132132
{

setup.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
from setuptools import setup, find_packages
2+
import os
3+
4+
with open("README.md", "r", encoding="UTF-8") as fh:
5+
long_description = fh.read()
6+
7+
with open("version.txt", "r", encoding="utf-8") as version_file:
8+
version = version_file.read().strip()
29

310
setup(
411
name="learn_to_pick",
5-
version="0.1",
12+
version=version,
613
install_requires=[
714
"numpy",
815
"pandas",
@@ -14,7 +21,9 @@
1421
],
1522
extras_require={"dev": ["pytest", "black==23.10.0"]},
1623
author="VowpalWabbit",
17-
description="",
24+
description="a python library for online learning RL loops, specialized for Contextual Bandit scenarios.",
25+
long_description_content_type="text/markdown",
26+
long_description=long_description,
1827
packages=find_packages(where="src"),
1928
package_dir={"": "src"},
2029
url="https://github.com/VowpalWabbit/learn_to_pick",

tests/unit_tests/pytest.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

0 commit comments

Comments
 (0)