Skip to content

Commit

Permalink
Standardise record value setting/getting (#60)
Browse files Browse the repository at this point in the history
Overhaul record value setting/getting, and introduce new longStringIn/longStringOut record types.

The new longStringIn/longStringOut record types are specialized for handling Python (Unicode) strings only.

There are considerable changes in how all record types handle incoming values, including dropping support for some previously supported types. The canonical list of valid types for record types is the tests - see `record_values_list` in `test_record_values.py` for the list of valid cases.

Due to an epicscorelibs version bump, existing checkouts will need to do a complete reinstall - see rough guide in `Contributing.rst` in the new "Updating Dependencies" section.
  • Loading branch information
AlexanderWells-diamond committed Jan 25, 2022
1 parent 3866562 commit 91fc8e3
Show file tree
Hide file tree
Showing 19 changed files with 1,881 additions and 636 deletions.
53 changes: 46 additions & 7 deletions .github/workflows/code.yml
Expand Up @@ -2,7 +2,15 @@ name: Code CI

on:
push:
branches:
- master
- main
tags:
- "*"
pull_request:
schedule:
# Run every Monday at 8am
- cron: '0 8 * * MON'

jobs:
lint:
Expand Down Expand Up @@ -30,15 +38,18 @@ jobs:
python: [cp36, cp37, cp38, cp39]

include:
# Put coverage in the project directory for mac
# Put coverage and results files in the project directory for mac
- os: macos-latest
cov_file: "{project}/dist/coverage.xml"
results_file: "{project}/dist/pytest-results.xml"
# And for windows
- os: windows-latest
cov_file: "{project}/dist/coverage.xml"
# But put coverage in the output dir mounted in docker for linux
results_file: "{project}/dist/pytest-results.xml"
# But put coverage and results files in the output dir mounted in docker for linux
- os: ubuntu-latest
cov_file: /output/coverage.xml
results_file: /output/pytest-results.xml
# Build an sdist on linux so it has the right line endings
- os: ubuntu-latest
sdist: true
Expand All @@ -60,7 +71,8 @@ jobs:
python-version: "3.7"

- name: Install Python Dependencies
run: pip install build cibuildwheel==1.* # The 2.* releases dropped Python2 support.
# Pin cibuildwheel due to https://github.com/pypa/cibuildwheel/issues/962
run: pip install build cibuildwheel>=2.3.1

- name: Build Sdist
if: matrix.sdist
Expand All @@ -69,14 +81,17 @@ jobs:
- name: Build Wheel
run: cibuildwheel --output-dir dist
env:
# Force old behaviour of pip - see https://github.com/pypa/cibuildwheel/issues/962
CIBW_ENVIRONMENT: PIP_USE_DEPRECATED=out-of-tree-build
CIBW_BUILD: ${{ matrix.python }}*64
CIBW_TEST_EXTRAS: dev
CIBW_TEST_COMMAND: pytest {project}/tests --cov-report xml:${{ matrix.cov_file }}
CIBW_TEST_COMMAND: pytest {project}/tests --cov-report xml:${{ matrix.cov_file }} --junit-xml=${{ matrix.results_file }}
# Disable auditwheel as it isn't compatible with setuptools_dso approach
# https://github.com/mdavidsaver/setuptools_dso/issues/17
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_ENVIRONMENT_LINUX: SETUPTOOLS_DSO_PLAT_NAME=manylinux1_x86_64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_ENVIRONMENT_LINUX: SETUPTOOLS_DSO_PLAT_NAME=manylinux2014_x86_64
CIBW_SKIP: "*-musllinux*" # epicscorelibs doesn't build on musllinux platforms

- name: Upload Wheel and Sdist
uses: actions/upload-artifact@v2
Expand All @@ -90,6 +105,30 @@ jobs:
name: ${{ matrix.os }}/${{ matrix.python }}
directory: dist

- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results (${{ matrix.os }}-${{ matrix.python }})
path: dist/pytest-results.xml

publish-test-results:
name: Publish Unit Tests Results
needs: build
runs-on: ubuntu-latest
if: always()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: artifacts/**/*.xml

release:
needs: [build]
runs-on: ubuntu-latest
Expand All @@ -115,4 +154,4 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: pipx run twine upload dist/*
run: pipx run twine upload dist/*
6 changes: 6 additions & 0 deletions .github/workflows/docs.yml
Expand Up @@ -2,6 +2,12 @@ name: Docs CI

on:
push:
branches:
# Add more branches here to publish docs from other branches
- master
- main
tags:
- "*"
pull_request:

jobs:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -13,6 +13,10 @@ Changed:

- `Remove python2 support <../../pull/64>`
- `Default DISP to TRUE for all In records <../../pull/74>`
- `Overhaul record value setting/getting <../../pull/60>`

Added:
- New longStringIn/longStringOut record types

3.2.1_ - 2021-11-25
-------------------
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.rst
Expand Up @@ -26,6 +26,21 @@ While 100% code coverage does not make a library bug-free, it significantly
reduces the number of easily caught bugs! Please make sure coverage remains the
same or is improved by a pull request!


Updating Dependencies
---------------------

pythonSoftIoc has a variety of types of dependencies, from Python module to
C files and built libraries. If it is necessary to update any of them, the
safest way to do that is::

$ Ensure all changes are committed/saved/backed up
$ pipenv --rm
$ pipenv run gitclean
$ rm Pipfile.lock
$ Update dependencies in setup.cfg / pyproject.toml
$ pipenv install --dev

Code Styling
------------

Expand Down

0 comments on commit 91fc8e3

Please sign in to comment.