Skip to main content

ocpiupdate - An updater for OpenCPI projects

pypi release gitlab pre-commit codecov

ocpiupdate updates OpenCPI Projects to use style associated with newer versions of OpenCPI.

For example:

  • Using <worker>-<model>.xml for the Worker Description files, instead of <worker>.xml.
  • Using <component>.comp/<component>-comp.xml for Component Specification files instead of specs/<component>[-_]spec.xml.
  • Using xml files instead of Makefiles.

Dependencies

This library requires Python 3.12 or newer. This means it doesn't support the default system python3 install on Ubuntu 20.04 or Ubuntu 22.04.

If you use a system with Python 3.11 or older, you need to either:

  • Install a newer python3 just for this library.
    • I'd recommend using a tool like uv.
  • Download and run the containerised version.

Installation

pip

You can install the latest release from PyPi:

pip install ocpiupdate

Or, you can install this repository directly:

# Installs `develop` branch
pip install git+https://gitlab.com/dawalters/ocpiupdate

# Installs `v0.6.4` tag
pip install git+https://gitlab.com/dawalters/ocpiupdate@v0.6.4

docker or podman

A Dockerfile is available that builds a container that can run ocpiupdate.

You can download prebuilt containers from the Gitlab Container Registry. This happens automatically when running a registry image without a local copy.

See scripts/ocpiupdate.sh for a script that allows running the ocpiupdate:latest container over more than one project.

To download and use this script:

# If you want to keep a local copy of the script
curl -o ocpiupdate.sh https://gitlab.com/dawalters/ocpiupdate/-/raw/develop/scripts/ocpiupdate.sh
source ocpiupdate.sh

# If you don't want to keep a local copy of the script
source <(curl -s https://gitlab.com/dawalters/ocpiupdate/-/raw/develop/scripts/ocpiupdate.sh)

You can then use the terminal command ocpiupdate in exactly the same way as the python script.

If you have built a local version of the container, then ocpiupdate.sh will use that. Otherwise, it will download the container from the remote registry.

Source tarball

You can download source releases from the Gitlab Releases page.

Configuration

The various functions that ocpiupdate performs are called actions.

You can view all available actions:

ocpiupdate --actions
rename_hdl_owds_to_hyphen_hdl
rename_rcc_owds_to_hyphen_rcc
rename_spec_to_comp_except_project
rename_protocol_to_prot
rename_underscore_prot_to_hyphen_prot
translate_applications_from_makefile_to_xml
translate_hdl_adapters_from_makefile_to_xml
translate_hdl_assemblies_from_makefile_to_xml
translate_hdl_cards_from_makefile_to_xml
translate_hdl_device_from_makefile_to_xml
translate_hdl_platforms_from_makefile_to_xml
translate_hdl_primitives_from_makefile_to_xml
translate_hdl_worker_from_makefile_to_xml
translate_project_from_makefile_to_xml
translate_rcc_worker_from_makefile_to_xml

If you encounter issues with an action, you can disable it:

ocpiupdate \
    --skip-action rename_protocol_to_prot \
    --skip-action rename_underscore_prot_to_hyphen_prot \
    $project

Disclaimer

This repository has no affiliation with OpenCPI.

The maintainer doesn't maintain OpenCPI.

The maintainer does not guarantee that ocpiupdate will result in a buildable project. If you encounter difficulties, please open an issue.

Metadata

Release files for ocpiupdate 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocpiupdate 0.6.4
File Size Uploaded
ocpiupdate-0.6.4.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocpiupdate 0.6.4
File Interpreter ABI Platform
ocpiupdate-0.6.4-py3-none-any.whl Python 3 none any Details

Total release size: 45.8 kB

Release files / ocpiupdate-0.6.4.tar.gz

Download URL ocpiupdate-0.6.4.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
14656b1cc5475342c51f9ae64a90233ba869a764c5cb4200965cd6f809b82198
BLAKE2b-256 checksum
How to use checksums
074aaea49f0836e25fcde5826f1fdedc844f103d74861ee2f3b885ee315d343c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / ocpiupdate-0.6.4-py3-none-any.whl

Download URL ocpiupdate-0.6.4-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
668e1a8320b5e7a8bc2f48675b8b1f3e165aa8d8c1f36810c344dd8a6d85ad9c
BLAKE2b-256 checksum
How to use checksums
9972154f529c9bd04b9a36e67aaa6ca70ad0e8c6b9efebbfdd8295531f4b57ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.6.4 This release

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page