Skip to content

Commit

Permalink
Add GitHub action to publish to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGalewsky committed Oct 2, 2022
1 parent 9040c5d commit e6c7a27
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Push to PyPI

on:
release:
types: [released, prereleased]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
- name: Build the mlflow_slurm wheel
env:
mlflow_slurm_version: ${{ github.ref }}
run: |
python -m build --sdist --wheel
- name: Publish servicex to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password}}
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os
import setuptools

version = os.getenv("mlflow_slurm_version")
if version is None:
version = "0.1a1"
else:
version = version.split("/")[-1]

here = os.path.abspath(os.path.dirname(__file__))

DESCRIPTION = "Backend implementation for running MLFlow projects on Slurm"
Expand Down Expand Up @@ -39,7 +45,7 @@ def _read_reqs(relpath):
setuptools.setup(
name="mlflow_slurm",
packages=setuptools.find_packages(),
version=0.1,
version=version,
install_requires=REQUIREMENTS,
package_data={'mlflow_slurm.templates': ['sbatch_template.sh']},
include_package_data=True,
Expand Down

0 comments on commit e6c7a27

Please sign in to comment.