Skip to content

Commit

Permalink
Support building and publishing to PYPI (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 authored Jan 20, 2025
1 parent 6dc762b commit d5a1aec
Show file tree
Hide file tree
Showing 17 changed files with 322 additions and 271 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Binary file removed docs/source/_static/logo.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/source/_static/logo.png
Binary file removed docs/source/_static/logo_dark.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/source/_static/logo_dark.png
59 changes: 7 additions & 52 deletions qe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@
"load_profile();"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from aiidalab_widgets_base.utils.loaders import load_css\n",
"\n",
"load_css(css_path=\"src/aiidalab_qe/app/static/styles\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -50,43 +39,6 @@
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from aiidalab_qe.app.wrapper import AppWrapperContoller, AppWrapperModel, AppWrapperView\n",
"\n",
"model = AppWrapperModel()\n",
"view = AppWrapperView()\n",
"controller = AppWrapperContoller(model, view)\n",
"\n",
"display(view)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from aiidalab_qe.app.main import App\n",
"from aiidalab_widgets_base.bug_report import (\n",
" install_create_github_issue_exception_handler,\n",
")\n",
"\n",
"install_create_github_issue_exception_handler(\n",
" view.output,\n",
" url=\"https://github.com/aiidalab/aiidalab-qe/issues/new\",\n",
" labels=(\"bug\", \"automated-report\"),\n",
")\n",
"\n",
"app = App(qe_auto_setup=True)\n",
"\n",
"view.main.children = [app]"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -95,10 +47,13 @@
"source": [
"import urllib.parse as urlparse\n",
"\n",
"from aiidalab_qe.app.main import QeApp\n",
"\n",
"url = urlparse.urlsplit(jupyter_notebook_url) # noqa F821\n",
"query = urlparse.parse_qs(url.query)\n",
"if \"pk\" in query:\n",
" app.process = query[\"pk\"][0]"
"pk = query[\"pk\"][0] if \"pk\" in query else None\n",
"\n",
"app = QeApp(process=pk)"
]
},
{
Expand All @@ -107,13 +62,13 @@
"metadata": {},
"outputs": [],
"source": [
"controller.enable_controls()"
"app.load()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ dev =

[options.package_data]
aiidalab_qe.app.parameters = qeapp.yaml
aiidalab_qe.app.static.images = *
aiidalab_qe.app.static.styles = *.css
aiidalab_qe.app.static.templates = *.jinja
aiidalab_qe.app.structure.examples = *
Expand Down
Loading

0 comments on commit d5a1aec

Please sign in to comment.