Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 15 additions & 22 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,24 @@ name: java-access-bridge-wrapper

on:
push:
paths:
paths:
- src/**
- .github/workflows/**

jobs:
lint:
# Not using the latest ubuntu until this issue is fixed in setup-python:
# https://github.com/actions/setup-python/issues/401
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.12
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install requirements
run: pip install -Ur requirements.txt
- name: Set up cache
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: invoke update
- name: Run lint
run: invoke lint
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
run: uv python install 3.10

- name: Install dependencies
run: uv sync --all-groups

- name: Run lint
run: uv run inv lint
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,44 +69,48 @@ Once the JABWrapper object is initialized, attach to some frame and optionally c

## Prerequisites

1. Install Invoke, Poetry and the other required dependencies in order to be able to develop and package the library:
`pip install -Ur requirements.txt`.
- If you want to isolate these from the other projects and not rely on the OS
Python, enable a (_pyenv_) virtual environment first by following these
[instructions](https://github.com/robocorp/rpaframework/blob/master/docs/source/contributing/development.md#virtual-environments).
2. Now you're ready to set-up Poetry for the first time with `inv setup`.
- Check with `-h` on how to pass credentials for ensuring that both your production PyPI and CI DevPI are
configured. You'll find these in our **Robocorp** > **Shared** 1Password by searching for keywords like "pypi"
(where we recommend a personal _token_ instead) and "devpi".
3. Run `inv update` so the library gets ready for development.
* [uv](https://docs.astral.sh/uv/) - Fast Python package manager

## Setup

Install all dependencies (including dev tools):

uv sync --all-groups

## Testing

Run test script against a simple Swing application.

Set environment variable
Set environment variable:

set RC_JAVA_ACCESS_BRIDGE_DLL="C:\path\to\Java\bin\WindowsAccessBridge-64.dll"

Update requirements and install the library in development mode
Run tests:

inv test # run all tests
inv test -t test_jab_wrapper.py # run tests from a file
inv test -t test_jab_wrapper.py::test_depth -c # specific test with output
inv test -s # simple mode (single scenario, no callbacks)

## Linting

Check code style:

inv update
inv lint

Run tests
Apply formatting fixes:

inv test # runs all the tests in all scenarios
inv test -s -t test_jab_wrapper.py # runs all the tests from a file in one simple common scenario
inv test -s -c -t test_jab_wrapper.py::test_depth # as above, but specific test and captures output
inv lint -a

## Packaging

Check linting
Build and publish:

inv lint # apply with '-a'
inv publish

Building and publishing
Build only (no publish):

inv publish # '-c' for DevPI
inv publish --build-only

## TODO:

Expand Down
Loading