Skip to content
Merged
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
65 changes: 15 additions & 50 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,23 @@ jobs:

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be
# mildly cleaner by using an environment variable, but I don't really care.
- name: cache poetry install
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-1.4.2-0
# Install Poetry. You could do this manually, or there are several actions that do this.
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
# Poetry's default install script, which feels correct. I pin the Poetry version here
# because Poetry does occasionally change APIs between versions and I don't want my
# actions to break if it does.
#
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
# venv as a `.venv` in your testing directory, which allows the next step to easily
# cache it.
- uses: snok/install-poetry@v1
with:
version: 1.4.2
virtualenvs-create: true
virtualenvs-in-project: true
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
- name: cache deps
id: cache-deps
uses: actions/cache@v3
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
# Install dependencies. `--no-root` means "install all dependencies but not the project
# itself", which is what you want to avoid caching _your_ code. The `if` statement
# ensures this only runs on a cache miss.
- run: poetry install --no-interaction --no-root --with dev
if: steps.cache-deps.outputs.cache-hit != 'true'
version: 'latest'
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Setup Python
run: uv python install "${{ matrix.python-version }}"

# Now install _your_ project. This isn't necessary for many types of projects -- particularly
# things like Django apps don't need this. But it's a good idea since it fully-exercises the
# pyproject.toml and makes that if you add things like console-scripts at some point that
# they'll be installed and working.
- run: poetry install --no-interaction
- name: Install dependencies
run: uv sync --locked --all-extras --dev

# And finally run tests. I'm using pytest and all my pytest config is in my `pyproject.toml`
# so this line is super-simple. But it could be as complex as you need.
- run: poetry run pytest
- name: Run Tests
run: uv run pytest
39 changes: 18 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,24 @@ on:
jobs:
publish:
name: Publish to PyPI
runs-on:
ubuntu-latest
environment: pypi
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
poetry-version: [ "1.4.2" ]
os: [ ubuntu-latest ]
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Build Project
run: poetry build
- name: Upload release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install Python 3.13
run: uv python install 3.13
- name: Build
run: uv build
# Check that basic features work and we didn't miss to include crucial files
- name: Smoke test (wheel)
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
- name: Publish
run: uv publish

Copilot AI Oct 29, 2025

Copy link

Choose a reason for hiding this comment

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

The 'uv publish' command requires authentication credentials but the workflow no longer uses the 'pypa/gh-action-pypi-publish' action which handled OIDC authentication automatically. This change may cause publish failures without proper credential configuration.

Suggested change
run: uv publish
run: uv publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

Copilot uses AI. Check for mistakes.
19 changes: 11 additions & 8 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.10"
python: "3.12"
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs

create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --group docs
install:
- "true"

# Build documentation using Sphinx
sphinx:
configuration: docs/source/conf.py
fail_on_warning: true


8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Developer Setup
```
git clone https://github.com/mdsol/rwslib
```
2. Install poetry and start a shell
2. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) and start a shell
```bash
$ pip install poetry
$ poetry shell
$ pipx install uv
$ uv shell
```
3. Install the development dependencies
```bash
$ poetry install --with dev
$ uv sync --group dev
```
4. Enjoy !!!

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = poetry run sphinx-build
SPHINXBUILD = uv run sphinx-build
PAPER =
BUILDDIR = build

Expand Down
7 changes: 5 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from sphinx_pyproject import SphinxConfig

config = SphinxConfig("../../pyproject.toml", globalns=globals(), style="poetry")
config = SphinxConfig("../../pyproject.toml", globalns=globals())


# -- General configuration -----------------------------------------------------
Expand Down Expand Up @@ -47,8 +47,11 @@
# |version| and |release|, also used in various other places throughout the
# built documents.

# project name
name = config.name

# The full version, including alpha/beta/rc tags.
release = version
release = config.version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
28 changes: 28 additions & 0 deletions docs/source/odm_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,31 @@ Example::
</ODM>




LabAnalyteRangesRequest(project_name)
-----------------------------------------

Authorization is required for this request.

Retrieve Lab Data with the Lab Analyte Ranges CSV Dataset.
**Note**: This service only outputs local lab data, and lab analyte unit ranges only.

Calls::

https://{{ host }}/RaveWebServices/datasets/LabAnalyteRanges.csv?studyoid={project_name}


Example::

>>> from rwslib import RWSConnection
>>> from rwslib.rws_requests.odm_adapter import *
>>> r = RWSConnection('https://innovate.mdsol.com', 'username', 'password')
>>> ranges = r.send_request(LabAnalyteRangesRequest('SIMPLESTUDY(Prod)'))
>>> import csv
>>> from io import StringIO
>>> f = StringIO(ranges)
>>> reader = csv.DictReader(f)
>>> for row in reader:
... print(row)

Loading