Skip to content

Commit

Permalink
Merge branch 'main' into agoose77/ci-test-downstream
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jun 16, 2023
2 parents a970ff1 + 47975bd commit c11d68e
Show file tree
Hide file tree
Showing 247 changed files with 9,412 additions and 6,678 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/deploy-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Prepare build files
run: pipx run nox -s prepare

- uses: pypa/cibuildwheel@v2.12.1
- uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down Expand Up @@ -138,9 +138,9 @@ jobs:
- name: Prepare build files
run: pipx run nox -s prepare

- uses: docker/setup-qemu-action@v2.1.0
- uses: docker/setup-qemu-action@v2.2.0

- uses: pypa/cibuildwheel@v2.12.1
- uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_ARCHS: ${{ matrix.arch }}
Expand All @@ -166,12 +166,14 @@ jobs:
needs: [build_wheels, build_alt_wheels, make_sdist]
runs-on: ubuntu-latest
if: inputs.publish-pypi
permissions:
id-token: write
environment:
name: "deploy-cpp-pypi"
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_PASSWORD_CPP }}
- uses: pypa/[email protected]
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ jobs:
needs: [build, check-requirements, check-cpp-on-pypi]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published') || inputs.publish-pypi
permissions:
id-token: write
environment:
name: "deploy-pypi"
steps:
- uses: actions/download-artifact@v3
with:
name: distributions
path: dist

- uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_PASSWORD }}
- uses: pypa/[email protected]

publish-headers:
name: "Publish header-only libraries alongside release"
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/docs-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sync Docs Selector

on:
push:
branches:
- main
paths:
- docs/switcher.json

concurrency:
group: 'docs-version-${{ github.head_ref || github.run_id }}'
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-20.04
name: Push version switcher
permissions:
id-token: write
contents: read
env:
S3_BUCKET: "awkward-array.org"
CLOUDFRONT_ID: "EFM4QVENUIXHS"
environment:
name: docs-prod
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-2
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
# Pushes to main trigger latest
- name: Push version selector
run: |
aws s3 cp docs/switcher.json "s3://${S3_BUCKET}/doc/switcher.json"
aws cloudfront create-invalidation --distribution-id "${CLOUDFRONT_ID}" \
--paths "/doc/switcher.json"
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ jobs:
# solve with different external library versions. By default,
# ROOT uses cxx-compiler too, so hopefully this won't be an issue
- name: Setup Python via Conda
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
# Cache invalidates daily by default
cache-env: true
cache-environment: true
cache-downloads: true
environment-file: docs/environment.yml
extra-specs: |
create-args: >-
python=${{ env.PYTHON_VERSION }}
doxygen
Expand Down Expand Up @@ -157,13 +157,13 @@ jobs:
# solve with different external library versions. By default,
# ROOT uses cxx-compiler too, so hopefully this won't be an issue
- name: Setup Python via Conda
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
# Cache invalidates daily by default
cache-env: true
cache-environment: true
cache-downloads: true
environment-file: docs/environment.yml
extra-specs: |
create-args: >-
python=${{ env.PYTHON_VERSION }}
doxygen
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/packaging-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ jobs:
- name: Prepare build files
run: pipx run nox -s prepare

- uses: pypa/cibuildwheel@v2.12.1
- uses: pypa/cibuildwheel@v2.13.1
env:
CIBW_ARCHS_MACOS: universal2
CIBW_BUILD: cp39-win_amd64 cp37-manylinux_x86_64 cp38-macosx_universal2
with:
config-file: cibuildwheel.toml
package-dir: awkward-cpp

- uses: pypa/cibuildwheel@v2.12.1
- uses: pypa/cibuildwheel@v2.13.1
if: matrix.os == 'ubuntu-latest'
env:
CIBW_BUILD: cp311-manylinux_x86_64
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
run: pipx run nox -s diagnostics -- --check-spec-sorted

- name: Install test requirements
run: python -m pip install -v -r requirements-test.txt
run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures

- name: Test specification
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
run: pipx run nox -s diagnostics -- --check-spec-sorted

- name: Install test requirements
run: python -m pip install -v -r requirements-test.txt
run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures

- name: Test specification
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
run: pipx run nox -s diagnostics -- --check-spec-sorted

- name: Install test requirements
run: python -m pip install -v -r requirements-test.txt
run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures

- name: Test specification
if: steps.cache-awkward-cpp-wheel.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -285,14 +285,12 @@ jobs:
submodules: true

- name: Setup Python via Conda
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
# Cache invalidates daily by default
cache-env: true
environment-file: false
cache-environment: true
environment-name: awkward
channels: conda-forge
extra-specs: |
create-args: >-
python=${{ env.PYTHON_VERSION }}
numpy
root
Expand Down Expand Up @@ -323,7 +321,7 @@ jobs:
run: python -m pip list

- name: Install test requirements
run: python -m pip install -v -r requirements-test.txt
run: python -m pip install -v -r requirements-test.txt pytest-github-actions-annotate-failures

- name: Test
run: python -m pytest -vv -rs tests
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
args: ["--pytest-test-first"]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.3.0
hooks:
- id: setup-cfg-fmt
args: [--include-version-classifiers, --max-py-version=3.11]
Expand All @@ -39,7 +39,7 @@ repos:
additional_dependencies: [pyyaml]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.261
rev: v0.0.272
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -59,7 +59,7 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.2"
rev: "v0.9.0.5"
hooks:
- id: shellcheck

Expand Down
21 changes: 13 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,16 @@ There are two kinds of releases: (1) `awkward-cpp` updates, which only occur whe

If you need your merged pull request to be deployed in a release, just ask!

#### Awkward-cpp releases
When making an `awkward-cpp` release (1), the following manual steps must also be taken:
- Creating a `git` tag `awkward-cpp-{version}` for the new version epoch.

#### Awkward releases
When making an `awkward` release (2), the following manual steps must also be taken:
- Attaching the `headers.zip` from the `deploy.yml` workflow to the release artefacts.
- Adding a `doc/switcher.json` entry for new minor/major versions.
#### `awkward-cpp` releases
To make an `awkward-cpp` release:
1. A commit to `main` should increase the version number in `awkward-cpp/pyproject.toml`
2. The [Deploy C++](https://github.com/scikit-hep/awkward/actions/workflows/deploy-cpp.yml) GitHub Actions workflow should be manually triggered.
3. A `git` tag `awkward-cpp-{version}` should be created for the new version epoch.

#### `awkward` releases
To make an `awkward` release:
1. A commit to `main` should increase the version number in `pyproject.toml`
2. A new GitHub release must be published.
3. A `docs/switcher.json` entry must be added for new minor/major versions.

Pushes that modify `docs/switcher.json` on `main` will automatically be synchronised with AWS.
18 changes: 0 additions & 18 deletions awkward-cpp/include/awkward/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ extern "C" {
const char* filename;
int64_t identity;
int64_t attempt;
bool pass_through;
};

const int8_t kMaxInt8 = 127; // 2**7 - 1
Expand All @@ -76,7 +75,6 @@ extern "C" {
out.filename = nullptr;
out.identity = kSliceNone;
out.attempt = kSliceNone;
out.pass_through = false;
return out;
};

Expand All @@ -91,22 +89,6 @@ extern "C" {
out.filename = filename;
out.identity = identity;
out.attempt = attempt;
out.pass_through = false;
return out;
};

inline struct Error
failure_pass_through(
const char* str,
int64_t identity,
int64_t attempt,
const char* filename) {
struct Error out;
out.str = str;
out.filename = filename;
out.identity = identity;
out.attempt = attempt;
out.pass_through = true;
return out;
};
}
Expand Down
Loading

0 comments on commit c11d68e

Please sign in to comment.