-
Notifications
You must be signed in to change notification settings - Fork 3
✨ Initial implementation #1
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
Merged
Merged
Changes from 48 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
ae47392
migrated src tracing here and add infra
juiwenchen f347c64
refactor name
juiwenchen 482cba0
add ci and update ignore for mypy
juiwenchen 3cbde6e
add action
juiwenchen 7e7deb5
updated gitignore
juiwenchen 384343d
add docs
juiwenchen 1e600e4
remove leading spaces
juiwenchen 177adfd
updated remote-url
juiwenchen c822c4f
adapted new repo
juiwenchen d55a864
fix bugs and improve config validation
juiwenchen d47566f
added configuration for src-trace
juiwenchen c2c2ba6
fixed mypy errors
juiwenchen d897edb
improve config validation
juiwenchen d5bc060
fixed mypy
juiwenchen edefdbe
improve config validation
juiwenchen 4b0bf7a
disabled color for testing
juiwenchen 97a2c19
strip ANSI
juiwenchen 85e1592
set NO_COLOR
juiwenchen 9a57ed3
removed first two lines
juiwenchen bdc569d
ignore format from typer
juiwenchen 3fb60a2
improved docs
juiwenchen 1988da7
updated pyproject
juiwenchen 2b8dc69
added installation doc
juiwenchen b8e60ef
update docs
juiwenchen 9d79598
add development docs
juiwenchen 790050a
changed layout of docs
juiwenchen c3524aa
added CLI docs
juiwenchen 57b1ac0
added typer ext
juiwenchen b5c0981
updated build cmd
juiwenchen 1b8ff12
added contributing docs
juiwenchen 33eedf8
update docs
juiwenchen f5a60b4
update oneline docs
juiwenchen fe6a476
updated docs
juiwenchen 67c2ed7
added caution
juiwenchen a7600ab
enhance online docs
juiwenchen 1eba831
added release action
juiwenchen ed0b2d0
test release action
juiwenchen 1f99f62
test github_page
juiwenchen da93659
update release action
juiwenchen 4eba349
use rye build
juiwenchen a916a49
remove test gh page
juiwenchen baaf83c
specified package location
juiwenchen 95e1bdd
updated permission
juiwenchen 2e7dd45
updated package-dir
juiwenchen a4ed9fb
updated
juiwenchen b304b51
updated
juiwenchen 5ab9d39
updated
juiwenchen a3a5d7c
updated
juiwenchen 54fa062
Reformatted docs
ubmarco c0af6b2
Rewrite some docs
ubmarco 6521dbb
Wording
ubmarco 8ffee7a
updated according to the review
juiwenchen a68da45
make CI happy
juiwenchen 65663b5
confirm relative path
juiwenchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Set up rye | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| # rye uses uv under the hood, so we need to set the cache directory correctly, based on the OS | ||
| - name: Set UV_CACHE_DIR for Linux | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| echo "UV_CACHE_DIR=/home/runner/.cache/uv" >> $GITHUB_ENV | ||
| shell: bash | ||
| - name: Set MATURIN_PEP517_ARGS for Linux | ||
| if: runner.os == 'Linux' | ||
| # make sure we always use zig, to get manylinux2014 compatible rust binaries | ||
| run: | | ||
| echo "MATURIN_PEP517_ARGS=--zig" >> $GITHUB_ENV | ||
| shell: bash | ||
| - name: Set UV_CACHE_DIR for MacOS | ||
| if: runner.os == 'macOS' | ||
| run: echo "UV_CACHE_DIR=/Users/gh-runner/Library/Caches/uv" >> $GITHUB_ENV | ||
| shell: bash | ||
| - name: Set UV_CACHE_DIR for Windows | ||
| if: runner.os == 'Windows' | ||
| run: echo "UV_CACHE_DIR=C:\\Users\\useblocks\\AppData\\Local\\uv-${{ runner.name }}" >> $env:GITHUB_ENV | ||
| shell: pwsh | ||
| # now install rye and sync the dependencies | ||
| - uses: eifinger/setup-rye@v4 | ||
| with: | ||
| version: "0.42.0" | ||
| enable-cache: false | ||
| - run: rye sync | ||
| shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: ci | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+*" | ||
| pull_request: | ||
| types: [closed, labeled, reopened, unlabeled, synchronize, opened] | ||
|
|
||
| concurrency: | ||
| # For PRs, cancel in progress runs, if a new commit is pushed | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| # These permissions are needed to interact with GitHub's OIDC Token endpoint. | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| jobs: | ||
| pre-commit: | ||
| name: Pre-commit | ||
| runs-on: [self-hosted, linux, x64] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version-file: ".python-version" | ||
| - run: python -m pip install pre-commit pre-commit-uv | ||
| # - uses: pre-commit/action@v3.0.1 # note we don't use this, since it calls ations/cache, which actually takes longer than without it | ||
| - run: pre-commit run --all --show-diff-on-failure --color=always | ||
|
|
||
| mypy: | ||
| name: MyPy | ||
| runs-on: [self-hosted, linux, x64] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: ./.github/actions/setup_rye | ||
| - run: rye run mypy:all | ||
|
|
||
| pytest: | ||
| name: Pytest (${{ matrix.os }}-${{ matrix.arch }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: linux | ||
| arch: x64 | ||
| - os: linux | ||
| arch: arm64 | ||
| - os: windows | ||
| arch: x64 | ||
| - os: macos | ||
| arch: arm64 | ||
|
|
||
| runs-on: [self-hosted, "${{ matrix.os }}", "${{ matrix.arch }}"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: ./.github/actions/setup_rye | ||
| - run: rye test -a | ||
|
|
||
| pytest-prod: | ||
| # pytest against packages installed as they would be in production | ||
| # i.e. as wheels that may contain obfuscated code | ||
|
|
||
| name: Pytest prod (${{ matrix.os }}-${{ matrix.arch }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: linux | ||
| arch: x64 | ||
| - os: linux | ||
| arch: arm64 | ||
| - os: windows | ||
| arch: x64 | ||
| - os: macos | ||
| arch: arm64 | ||
|
|
||
| runs-on: [self-hosted, "${{ matrix.os }}", "${{ matrix.arch }}"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: ./.github/actions/setup_rye | ||
| - run: rye run pytest:prod | ||
|
|
||
| docs: | ||
| name: Documentation build | ||
| runs-on: [self-hosted, linux, x64] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install graphviz | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| run: sudo apt-get --yes install graphviz | ||
| - uses: ./.github/actions/setup_rye | ||
| - name: Run documentation build | ||
| run: rye run docs | ||
|
|
||
| all_good: | ||
| # This job does nothing and is only used for the branch protection | ||
| # see https://github.com/marketplace/actions/alls-green#why | ||
|
|
||
| if: ${{ !cancelled() }} | ||
|
|
||
| needs: | ||
| - pre-commit | ||
| - mypy | ||
| - pytest | ||
| - pytest-prod | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| - docs | ||
|
|
||
| runs-on: [self-hosted, linux, x64] | ||
|
|
||
| steps: | ||
| - name: Decide whether the needed jobs succeeded or failed | ||
| uses: re-actors/alls-green@release/v1 | ||
| with: | ||
| jobs: ${{ toJSON(needs) }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Workflow for building and deploying the Sphinx site to GitHub Pages | ||
| # | ||
| name: Deploy docs to GH Pages | ||
|
|
||
| on: | ||
| # Runs on pushes targeting the default branch | ||
| push: | ||
| branches: ["main"] | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
| permissions: | ||
| contents: read | ||
| 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: | ||
| build: | ||
| name: Build | ||
| runs-on: [self-hosted, linux, x64] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Pages | ||
| id: pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Install graphviz | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| run: sudo apt-get --yes install graphviz | ||
| - uses: eifinger/setup-rye@v4 | ||
| - run: rye sync | ||
| - name: Run documentation build | ||
| run: rye run docs | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: docs/_build/html | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| needs: build | ||
| runs-on: [self-hosted, linux, x64] | ||
| name: Deploy | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Release | ||
| on: | ||
| push: | ||
| # tags: | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| # - '[0-9].[0-9]+.[0-9]+' | ||
|
|
||
| permissions: | ||
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build distribution 📦 | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
| - name: Install pypa/build | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use flit instead to build, just check this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm can we change it in the next PR? all i know now is it works now and it's from papy |
||
| run: >- | ||
| python3 -m | ||
| pip install | ||
| build | ||
| --user | ||
| - name: Build a binary wheel and a source tarball | ||
| run: python3 -m build | ||
| - name: Store the distribution packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| publish-to-pypi: | ||
| name: >- | ||
| Publish Python 🐍 distribution 📦 to PyPI | ||
| needs: | ||
| - build | ||
| runs-on: ubuntu-latest | ||
| # environment: | ||
| # name: pypi | ||
| # url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name | ||
| permissions: | ||
| id-token: write # IMPORTANT: mandatory for trusted publishing | ||
| steps: | ||
| - name: Download all the dists | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
| - name: Publish distribution 📦 to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # python generated files | ||
| .ruff_cache | ||
| .pytest_cache | ||
| .mypy_cache | ||
| __pycache__/ | ||
| *.py[oc] | ||
| build/ | ||
| dist/ | ||
| wheels/ | ||
| *.egg-info | ||
| .venv | ||
|
|
||
| # lock files | ||
| requirements.lock | ||
| requirements-dev.lock | ||
|
|
||
| # Sphinx build output | ||
| **/_build | ||
|
|
||
| # rye is the primary tool, uv is only used for on-the-fly setups | ||
| uv.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: pretty-format-json | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| args: [--autofix, --no-sort-keys] | ||
| files: (package\.json|tsconfig\.json)$ | ||
| types: [file] | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.7.1 | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| hooks: | ||
| - id: ruff-format | ||
| name: python format | ||
| - id: ruff | ||
| alias: ruff-check | ||
| name: python lint | ||
| args: [--fix] | ||
|
|
||
| - repo: https://github.com/ComPWA/taplo-pre-commit | ||
| rev: v0.9.3 | ||
| hooks: | ||
| - id: taplo-format | ||
| # lint fetches schemas online at each call, deactivate for now | ||
| - id: taplo-lint | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.12.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """ | ||
| Global pytest conftest.py. | ||
|
|
||
| This is needed due to: | ||
|
|
||
| pytest test discovery error for workspace: /home/marco/ub/ubtrace | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
| Failed: Defining 'pytest_plugins' in a non-top-level conftest is no longer supported: | ||
| It affects the entire test suite instead of just below the conftest as expected. | ||
| /home/marco/ub/ubtrace/python/ubt_connect_core/tests/conftest.py | ||
| Please move it to a top level conftest file at the rootdir: | ||
| /home/marco/ub/ubtrace | ||
| For more information, visit: | ||
| https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-files | ||
|
|
||
| See also the root README.md. | ||
| """ | ||
|
|
||
| # Makes make_app avaialble | ||
| pytest_plugins = ("sphinx.testing.fixtures",) | ||
|
juiwenchen marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.