Skip to content

ci: Python SDK Publish - #3730

Merged
gerhard merged 2 commits into
mainfrom
python-publish
Nov 9, 2022
Merged

gerhard merged 2 commits into
mainfrom
python-publish

Conversation

@helderco

@helderco helderco commented Nov 8, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #3678
Fixes #3682
Fixes #3702

\cc @aluzzardi

@helderco helderco mentioned this pull request Nov 8, 2022
4 tasks done
Comment thread .github/workflows/publish-python.yml Resolved
@helderco
helderco force-pushed the python-publish branch 5 times, most recently from a23be27 to 606c78c Compare November 8, 2022 18:19
Comment thread internal/mage/sdk/python.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publish doesn't need the engine, is it still needed?

@helderco helderco Nov 8, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see... for running the Go SDK stuff.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aluzzardi When is util.WithDevEngine needed, really? Isn't it when the python code needs to connect to the API?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on a sync conversation, I also don't think that we need WithDevEngine (a.k.a. "dagger in dagger") since the command running inside the container is poetry which doesn't need access to Dagger.

@aluzzardi aluzzardi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- left one comment: after rebase, this will break, need to add a WithDevServer /cc @sipsma

@helderco
helderco marked this pull request as draft November 8, 2022 20:21
Comment thread sdk/python/pyproject.toml Resolved
Signed-off-by: Helder Correia <[email protected]>
@helderco
helderco marked this pull request as ready for review November 9, 2022 10:40
@helderco

helderco commented Nov 9, 2022

Copy link
Copy Markdown
Contributor Author

Bit the bullet and just switched to Poetry.

@helderco
helderco force-pushed the python-publish branch 4 times, most recently from 5b7ec2e to b9dbf2b Compare November 9, 2022 10:53
Poetry has a better handle on having a different package name from project name. There were some other issues that influenced the switch, including better dependabot support and reproducible dev enviornments.

Signed-off-by: Helder Correia <[email protected]>

@gerhard gerhard left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🚀

The next step is to check that everything works as expected by publishing an 0.1.0-alpha.1 package.

When we confirm that it behaves as expected, we should update ghcr.io/dagger/engine:test ENGINE_IMAGE_REF in sdk/python/src/dagger/connectors/base.py before we publish the final 0.1.0 release. Having reviewed pyproject.toml, there are a few changes in the classifiers that we may want to make before the final release.

By the way:

@gerhard
gerhard merged commit 94f086f into main Nov 9, 2022
@gerhard
gerhard deleted the python-publish branch November 9, 2022 12:10
@jpadams

jpadams commented Nov 9, 2022

Copy link
Copy Markdown
Contributor

Got API docs working! @helderco @vikram-dagger 😄

pip install sphinx sphinx_rtd_theme
pip install --pre dagger-io
git clone https://github.com/dagger/dagger
cd dagger/sdk/python
sphinx-apidoc -F -o docs/ src/dagger/
# edit docs/conf.py (use file below)
make -C docs html
cd docs/_build/html
python3 -m http.server
# open browser to localhost:8000

final conf.py

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'Dagger Python SDK API'
copyright = '2022, Dagger'
author = 'Dagger'
release = 'v0.1.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.viewcode',
    'sphinx.ext.todo',
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

language = 'en'

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

# -- Options for todo extension ----------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration

todo_include_todos = True

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to Poetry Add Python's CI pipeline to GitHub Actions Add Python's CI pipeline to mage

4 participants