Skip to content

Commit

Permalink
xcookie update
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Apr 16, 2024
1 parent 23894d0 commit 1167a64
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 62 deletions.
168 changes: 139 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python 3.11 for linting
uses: actions/setup-python@v4.7.1
uses: actions/checkout@v4.1.1
- name: Set up Python 3.12 for linting
uses: actions/setup-python@v5.0.0
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
run: |-
python -m pip install --upgrade pip
Expand All @@ -47,19 +47,19 @@ jobs:
os:
- ubuntu-latest
python-version:
- '3.11'
- '3.12'
arch:
- auto
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: runner.os == 'Linux' && matrix.arch != 'auto'
with:
platforms: all
- name: Setup Python
uses: actions/setup-python@v4.7.1
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Build pure wheel
Expand All @@ -71,13 +71,14 @@ jobs:
- name: Show built files
shell: bash
run: ls -la wheelhouse
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v3.1.3
name: Upload wheels artifact
with:
name: wheels
path: ./wheelhouse/ibeis*.whl
test_purepy_wheels:
name: ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
if: "! startsWith(github.event.ref, 'refs/heads/release')"
runs-on: ${{ matrix.os }}
needs:
- build_purepy_wheels
Expand All @@ -87,10 +88,6 @@ jobs:
# Xcookie generates an explicit list of environments that will be used
# for testing instead of using the more concise matrix notation.
include:
- python-version: '3.7'
install-extras: tests-strict,runtime-strict,headless-strict
os: ubuntu-latest
arch: auto
- python-version: '3.8'
install-extras: tests-strict,runtime-strict,headless-strict
os: ubuntu-latest
Expand All @@ -107,12 +104,12 @@ jobs:
install-extras: tests-strict,runtime-strict,headless-strict
os: ubuntu-latest
arch: auto
- python-version: '3.7'
install-extras: tests-strict,runtime-strict,optional-strict,headless-strict
- python-version: '3.12'
install-extras: tests-strict,runtime-strict,headless-strict
os: ubuntu-latest
arch: auto
- python-version: '3.7'
install-extras: tests,optional,headless
- python-version: '3.8'
install-extras: tests-strict,runtime-strict,optional-strict,headless-strict
os: ubuntu-latest
arch: auto
- python-version: '3.8'
Expand All @@ -131,19 +128,23 @@ jobs:
install-extras: tests,optional,headless
os: ubuntu-latest
arch: auto
- python-version: '3.12'
install-extras: tests,optional,headless
os: ubuntu-latest
arch: auto
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: runner.os == 'Linux' && matrix.arch != 'auto'
with:
platforms: all
- name: Setup Python
uses: actions/setup-python@v4.7.1
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v2.1.1
name: Download wheels
with:
name: wheels
Expand All @@ -160,6 +161,9 @@ jobs:
pip install tomli pkginfo
export WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('ibeis*.whl'))[-1]).replace(chr(92), chr(47)))")
export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
echo "$WHEEL_FPATH=WHEEL_FPATH"
echo "$INSTALL_EXTRAS=INSTALL_EXTRAS"
echo "$MOD_VERSION=MOD_VERSION"
pip install --prefer-binary "ibeis[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
echo "Install finished."
- name: Test wheel ${{ matrix.install-extras }}
Expand All @@ -177,6 +181,7 @@ jobs:
ls -altr
# Get the path to the installed package and run the tests
export MOD_DPATH=$(python -c "import ibeis, os; print(os.path.dirname(ibeis.__file__))")
export MOD_NAME=ibeis
echo "
---
MOD_DPATH = $MOD_DPATH
Expand All @@ -196,15 +201,19 @@ jobs:
if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags') && ! startsWith(github.event.ref, 'refs/heads/release')
needs:
- build_purepy_wheels
- test_purepy_wheels
steps:
- name: Checkout source
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
name: Download wheels and sdist
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v2.1.1
name: Download wheels
with:
name: wheels
path: wheelhouse
- uses: actions/download-artifact@v2.1.1
name: Download sdist
with:
name: sdist_wheels
path: wheelhouse
- name: Show files to upload
shell: bash
run: ls -la wheelhouse
Expand Down Expand Up @@ -232,22 +241,52 @@ jobs:
pip install urllib3 requests[security] twine
GPG_KEYID=$(cat dev/public_gpg_key)
echo "GPG_KEYID = '$GPG_KEYID'"
DO_GPG=True GPG_KEYID=$GPG_KEYID TWINE_REPOSITORY_URL=${TWINE_REPOSITORY_URL} TWINE_PASSWORD=$TWINE_PASSWORD TWINE_USERNAME=$TWINE_USERNAME GPG_EXECUTABLE=$GPG_EXECUTABLE DO_UPLOAD=True DO_TAG=False ./publish.sh
GPG_SIGN_CMD="$GPG_EXECUTABLE --batch --yes --detach-sign --armor --local-user $GPG_KEYID"
WHEEL_PATHS=(wheelhouse/*.whl wheelhouse/*.tar.gz)
WHEEL_PATHS_STR=$(printf '"%s" ' "${WHEEL_PATHS[@]}")
echo "$WHEEL_PATHS_STR"
for WHEEL_PATH in "${WHEEL_PATHS[@]}"
do
echo "------"
echo "WHEEL_PATH = $WHEEL_PATH"
$GPG_SIGN_CMD --output $WHEEL_PATH.asc $WHEEL_PATH
$GPG_EXECUTABLE --verify $WHEEL_PATH.asc $WHEEL_PATH || echo "hack, the first run of gpg very fails"
$GPG_EXECUTABLE --verify $WHEEL_PATH.asc $WHEEL_PATH
done
ls -la wheelhouse
pip install opentimestamps-client
ots stamp wheelhouse/*.whl wheelhouse/*.tar.gz wheelhouse/*.asc
ls -la wheelhouse
twine upload --username __token__ --password "$TWINE_PASSWORD" --repository-url "$TWINE_REPOSITORY_URL" wheelhouse/*.whl wheelhouse/*.tar.gz --skip-existing --verbose || { echo "failed to twine upload" ; exit 1; }
- uses: actions/upload-artifact@v3.1.3
name: Upload deploy artifacts
with:
name: deploy_artifacts
path: |-
wheelhouse/*.whl
wheelhouse/*.zip
wheelhouse/*.tar.gz
wheelhouse/*.asc
wheelhouse/*.ots
live_deploy:
name: Uploading Live to PyPi
runs-on: ubuntu-latest
if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release'))
needs:
- build_purepy_wheels
- test_purepy_wheels
steps:
- name: Checkout source
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
name: Download wheels and sdist
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v2.1.1
name: Download wheels
with:
name: wheels
path: wheelhouse
- uses: actions/download-artifact@v2.1.1
name: Download sdist
with:
name: sdist_wheels
path: wheelhouse
- name: Show files to upload
shell: bash
run: ls -la wheelhouse
Expand Down Expand Up @@ -275,7 +314,78 @@ jobs:
pip install urllib3 requests[security] twine
GPG_KEYID=$(cat dev/public_gpg_key)
echo "GPG_KEYID = '$GPG_KEYID'"
DO_GPG=True GPG_KEYID=$GPG_KEYID TWINE_REPOSITORY_URL=${TWINE_REPOSITORY_URL} TWINE_PASSWORD=$TWINE_PASSWORD TWINE_USERNAME=$TWINE_USERNAME GPG_EXECUTABLE=$GPG_EXECUTABLE DO_UPLOAD=True DO_TAG=False ./publish.sh
GPG_SIGN_CMD="$GPG_EXECUTABLE --batch --yes --detach-sign --armor --local-user $GPG_KEYID"
WHEEL_PATHS=(wheelhouse/*.whl wheelhouse/*.tar.gz)
WHEEL_PATHS_STR=$(printf '"%s" ' "${WHEEL_PATHS[@]}")
echo "$WHEEL_PATHS_STR"
for WHEEL_PATH in "${WHEEL_PATHS[@]}"
do
echo "------"
echo "WHEEL_PATH = $WHEEL_PATH"
$GPG_SIGN_CMD --output $WHEEL_PATH.asc $WHEEL_PATH
$GPG_EXECUTABLE --verify $WHEEL_PATH.asc $WHEEL_PATH || echo "hack, the first run of gpg very fails"
$GPG_EXECUTABLE --verify $WHEEL_PATH.asc $WHEEL_PATH
done
ls -la wheelhouse
pip install opentimestamps-client
ots stamp wheelhouse/*.whl wheelhouse/*.tar.gz wheelhouse/*.asc
ls -la wheelhouse
twine upload --username __token__ --password "$TWINE_PASSWORD" --repository-url "$TWINE_REPOSITORY_URL" wheelhouse/*.whl wheelhouse/*.tar.gz --skip-existing --verbose || { echo "failed to twine upload" ; exit 1; }
- uses: actions/upload-artifact@v3.1.3
name: Upload deploy artifacts
with:
name: deploy_artifacts
path: |-
wheelhouse/*.whl
wheelhouse/*.zip
wheelhouse/*.tar.gz
wheelhouse/*.asc
wheelhouse/*.ots
release:
name: Create Github Release
if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release'))
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- live_deploy
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v2.1.1
name: Download artifacts
with:
name: deploy_artifacts
path: wheelhouse
- name: Show files to release
shell: bash
run: ls -la wheelhouse
- run: 'echo "Automatic Release Notes. TODO: improve" > ${{ github.workspace }}-CHANGELOG.txt'
- name: Tag Release Commit
if: (startsWith(github.event.ref, 'refs/heads/release'))
run: |-
export VERSION=$(python -c "import setup; print(setup.VERSION)")
git tag "v$VERSION"
git push origin "v$VERSION"
- uses: softprops/action-gh-release@v1
name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
body: Automatic Release
generate_release_notes: true
draft: true
prerelease: false
files: |-
wheelhouse/*.whl
wheelhouse/*.asc
wheelhouse/*.ots
wheelhouse/*.zip
wheelhouse/*.tar.gz
###
Expand Down
2 changes: 1 addition & 1 deletion dev/setup_secrets.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
__doc__='
============================
SETUP CI SECRET INSTRUCTIONS
Expand Down
21 changes: 16 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
### For gitlab
The user will need to enable the repo on their readthedocs account:
https://readthedocs.org/dashboard/import/manual/?
To enable the read-the-docs go to https://readthedocs.org/dashboard/ and login
Make sure you have a .readthedocs.yml file
The user will need to enable the repo on their readthedocs account:
https://readthedocs.org/dashboard/import/manual/?
Click import project: (for github you can select, but gitlab you need to import manually)
Enter the following information:
Set the Repository NAME: ibeis
Set the Repository URL: https://github.com/Erotemic/ibeis
Make sure you have a .readthedocs.yml file
For gitlab you also need to setup an integrations. Navigate to:
https://readthedocs.org/dashboard/ibeis/integrations/create/
Expand Down Expand Up @@ -506,6 +506,17 @@ def text_art(lines):
new_lines.extend(lines[1:])
return new_lines

# @self.register_section(tag='TODO', alias=['.. todo::'])
# def todo_section(lines):
# """
# Fixup todo sections
# """
# import xdev
# xdev.embed()
# import ubelt as ub
# print('lines = {}'.format(ub.urepr(lines, nl=1)))
# return new_lines

@self.register_section(tag='Ignore')
def ignore(lines):
return []
Expand Down
Loading

0 comments on commit 1167a64

Please sign in to comment.