Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA for publishing to PyPI #21

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ permissions:
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Package to PyPI

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Build Package
run: |
pip install build
python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
runs-on: ubuntu-latest
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/zero-true
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 19 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[metadata]
name = zero-true
description = A collaborative notebook built for data scientists
version = 0.0.dev0

[options]
packages = find:
install_requires =
fastapi
uvicorn
pydantic
toml
pytest
astroid

[options.entry_points]
console_scripts =
zero-true = zt_cli.cli:start_servers
zero-true-dev = zt_dev_cli.cli:zt_cli
20 changes: 2 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
from setuptools import setup, find_packages
from setuptools import setup

# Read the contents of requirements.txt
with open('zt_backend/requirements.txt') as f:
requirements = f.read().splitlines()

setup(
name='zero-true',
version='0.1',
packages=find_packages(),
install_requires=requirements, # Use the requirements read from the file
entry_points={
'console_scripts': [
'zero-true=zt_cli.cli:start_servers',
'zero-true-dev=zt_dev_cli.cli:zt_cli',
],

}
)
setup()