Skip to content

Commit aa81b69

Browse files
authored
Merge branch 'main' into issue-221
2 parents c24b549 + c6d2257 commit aa81b69

File tree

123 files changed

+9113
-3653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+9113
-3653
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Default owners (lowest precedence).
2-
* @reyammer @invernizzi @ia0
2+
* @reyammer @invernizzi
33

44
# Julien owns the Rust code
55
/rust/ @ia0

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
steps:
5353
- name: Checkout repository
54-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
54+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
5555

5656
# Initializes the CodeQL tools for scanning.
5757
- name: Initialize CodeQL

.github/workflows/github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
working-directory: ./website
3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
34+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
3535
with:
3636
ref: main
3737
- name: Set up Node

.github/workflows/js-docs-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
26+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
2727
with:
2828
ref: main
2929
- name: Generate docs

.github/workflows/js-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
14+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
1515
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # pin@v4
1616
with:
1717
node-version: '20.x'

.github/workflows/js-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
os: [ "ubuntu-latest", "macos-latest" ]
2525
runs-on: ${{ matrix.os }}
2626
steps:
27-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
27+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
2828
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # pin@v4
2929
with:
3030
node-version: ${{ matrix.node-version }}

.github/workflows/maturin.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# This file is autogenerated by maturin v1.7.4 and manually modified by ia0.
2+
name: Maturin
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- 'main'
9+
tags:
10+
- 'python-v*'
11+
schedule:
12+
- cron: '12 3 * * 4' # Refresh the cache weekly.
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build:
20+
runs-on: ${{ matrix.platform.runner }}
21+
strategy:
22+
matrix:
23+
platform:
24+
- runner: ubuntu-latest
25+
target: x86_64
26+
- runner: windows-latest
27+
target: x64
28+
- runner: macos-14
29+
target: aarch64
30+
steps:
31+
- uses: actions/checkout@v4
32+
- if: matrix.platform.runner == 'ubuntu-latest'
33+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
34+
with:
35+
path: rust/onnx/runtime/build/Linux
36+
key: maturin-${{ matrix.platform.target }}-${{ hashFiles('rust/onnx/build.sh') }}
37+
- run: python3 ./python/scripts/fix_package_version.py
38+
- if: matrix.platform.runner == 'ubuntu-latest'
39+
name: Build wheels
40+
uses: PyO3/maturin-action@v1
41+
with:
42+
target: ${{ matrix.platform.target }}
43+
args: --release --out=../dist
44+
before-script-linux: "${{ github.workspace }}/rust/onnx/maturin.sh"
45+
manylinux: 2_28
46+
working-directory: python
47+
- if: matrix.platform.runner != 'ubuntu-latest'
48+
name: Build wheels
49+
uses: PyO3/maturin-action@v1
50+
with:
51+
target: ${{ matrix.platform.target }}
52+
args: --release --out=../dist
53+
working-directory: python
54+
- name: Install wheels
55+
run: python3 -m pip install $(python -c "import glob; print(glob.glob('dist/*.whl')[0])")
56+
- run: magika --version
57+
- run: python3 -c 'import magika; print(magika.__version__)'
58+
- run: magika -r tests_data/basic
59+
- run: python3 ./python/scripts/run_quick_test_magika_cli.py
60+
- run: python3 ./python/scripts/run_quick_test_magika_module.py
61+
- name: Upload wheels
62+
if: github.event_name != 'pull_request'
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.target }}
66+
path: dist
67+
68+
sdist:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
# TODO(https://github.com/PyO3/maturin/issues/2244): Remove when released.
73+
- run: rm rust/cli/README.md
74+
- run: python3 ./python/scripts/fix_package_version.py
75+
- name: Build sdist
76+
uses: PyO3/maturin-action@v1
77+
with:
78+
command: sdist
79+
args: --out=../dist
80+
working-directory: python
81+
- name: Upload sdist
82+
if: github.event_name != 'pull_request'
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: wheels-sdist
86+
path: dist

.github/workflows/python-e2e-test.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/python-pypi.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This routinely checks that published packages are installable and work
2+
# properly. This makes sure that a new version of one of our dependencies is not
3+
# breaking our releases.
4+
# TODO: test more magika package versions
5+
# TODO: check the actual predicted content types
6+
name: Python - test published packages
7+
8+
on:
9+
schedule:
10+
- cron: '42 4 * * *' # Run daily
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
unit-testing:
18+
strategy:
19+
matrix:
20+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
21+
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # pin@v5
28+
with:
29+
python-version: '${{ matrix.python-version }}'
30+
31+
- name: Install magika
32+
run: python3 -m pip install magika
33+
- run: python3 -c 'import magika; m = magika.Magika(); print(m)'
34+
- run: magika --version
35+
# The latest published model does not necessarily support detection for
36+
# all types in our tests data; thus, for now we just check that the magika
37+
# CLI does not crash when scanning the files, without checking the actual
38+
# predictions.
39+
- run: magika -r tests_data/basic

0 commit comments

Comments
 (0)