Skip to content

Commit

Permalink
Build and release to PyPI too [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
maddenp committed Feb 24, 2024
1 parent de77244 commit 8172996
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/scripts/install-conda
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash -eux

url=https://github.com/conda-forge/miniforge/releases/download/23.1.0-4/Miniforge3-23.1.0-4-Linux-x86_64.sh
url=https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Miniforge3-23.11.0-0-Linux-x86_64.sh
wget --no-verbose $url
bash $(basename $url) -bfp conda
(
set -e +ux
source conda/etc/profile.d/conda.sh
conda activate
conda install -q -y -c maddenp --repodata-fn repodata.json anaconda-client condev
conda install -q -y -c maddenp --repodata-fn repodata.json anaconda-client build condev twine
)
7 changes: 7 additions & 0 deletions .github/scripts/pypi-package-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eux

set +ux
source conda/etc/profile.d/conda.sh
conda activate
set -ux
python -m build --no-isolation src
7 changes: 7 additions & 0 deletions .github/scripts/pypi-package-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eux

set +ux
source conda/etc/profile.d/conda.sh
conda activate
set -ux
twine upload --repository pypi --username __token__ --password $PYPI_TOKEN src/dist/*.whl
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@ on:
push:
branches:
- main
workflow_dispatch:
branches:
- '**'
jobs:
ci:
name: CI
name: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install conda
run: .github/scripts/install-conda
- name: Make package
run: .github/scripts/make-package
- name: Check tag
run: .github/scripts/tag-check
- name: Release
run: .github/scripts/release
- name: Install conda
run: .github/scripts/install-conda
- name: Build conda package
run: .github/scripts/conda-package-build
- name: Publish conda package
run: .github/scripts/conda-package-release
- name: Build PyPI package
run: .github/scripts/pypy-package-build
- name: Release PyPI package
run: .github/scripts/pypy-package-release
- name: Tag
run: .github/scripts/tag-create
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**It's One Thing After Another**

A tiny workflow manager with semantics similar to those of [Luigi](https://github.com/spotify/luigi), but with tasks defined as decorated Python functions (or methods, but "functions" will be used in this document). `iotaa` is pure Python, relies on no third-party packages, and is contained in a single module.
A simple workflow engine with semantics inspired by [Luigi](https://github.com/spotify/luigi) and tasks expressed as decorated Python functions (or methods, but "functions" will be used in this document). `iotaa` is pure Python, relies on no third-party packages, and is contained in a single module.

## Workflows

Expand Down
1 change: 1 addition & 0 deletions src/LICENSE
1 change: 1 addition & 0 deletions src/README.md
1 change: 1 addition & 0 deletions src/meta.json
13 changes: 12 additions & 1 deletion src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,26 @@
if os.environ.get("CONDA_BUILD"):
meta = {x: os.environ["PKG_%s" % x.upper()] for x in ("name", "version")}
else:
with open("../recipe/meta.json", "r", encoding="utf-8") as f:
with open("meta.json", "r", encoding="utf-8") as f:
meta = json.load(f)

name_conda = meta["name"]
name_py = name_conda.replace("-", "_")

setup(
author="Paul Madden",
author_email="[email protected]",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
data_files=[(".", ["meta.json"])],
description="A simple workflow engine",
entry_points={"console_scripts": ["iotaa = %s:main" % name_py]},
long_description="A simple workflow engine with semantics inspired by Luigi and tasks expressed as decorated Python functions",
name=name_conda,
packages=find_packages(include=[name_py, "%s.*" % name_py]),
url="https://github.com/maddenp/iotaa",
version=meta["version"],
)

0 comments on commit 8172996

Please sign in to comment.