Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pythonnet/clr-loader
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.3
Choose a base ref
...
head repository: pythonnet/clr-loader
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
42 changes: 42 additions & 0 deletions .github/workflows/ci-arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ARM64 Tests

on:
push:
branches: master
pull_request:

jobs:
build:
runs-on: [self-hosted, linux, ARM64]

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
6.0.x
- name: Create virtualenv
run: |
virtualenv -p python3 venv
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install pytest cffi
# Assumes recent Mono

- name: Build
run: |
source venv/bin/activate
pip install -e .
- name: Test with pytest
run: |
source venv/bin/activate
pytest
110 changes: 92 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,63 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python Tests

on: [push, pull_request]
on:
push:
branches: master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
- uses: astral-sh/setup-uv@v4
- name: Build
run: uv build
- name: Upload source distribution
uses: actions/upload-artifact@v3
with:
name: build-output
path: "dist/*"
if-no-files-found: error

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depths: 0
- uses: astral-sh/setup-uv@v4
- name: Install Ruff
run: uv tool install ruff
- name: Check format
run: ruff format --check
- name: Check lints
run: ruff check

test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ['3.9', '3.8', '3.7', '3.6', pypy3]
os: [ubuntu-22.04, windows-latest, macos-13]
python: ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] # pypy3

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest cffi
- name: Build
run: |
pip install -e .
- name: Cache Mono
if: runner.os == 'Windows'
uses: actions/cache@v2
@@ -42,6 +70,52 @@ jobs:
run: |
choco install -y mono ${{ matrix.python == 'pypy3' && '--x86' || '' }}
- name: Install dependencies
run: |
uv venv
uv pip install pytest
- name: Download wheel
uses: actions/download-artifact@v3
with:
name: build-output
path: dist/

- name: Install wheel
shell: bash
run: |
uv pip install dist/*.whl
- name: Test with pytest
run: |
pytest
uv run pytest
deploy:
runs-on: ubuntu-latest
needs: [build, test]

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: build-output
path: dist/

- name: Deploy to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/head/master')
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: dist/*

- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/v')
with:
password: ${{ secrets.PYPI_API_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Documentation

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build Sphinx documentation
run: |
pip install -r doc/requirements.txt
sphinx-build doc/ ./doc/_build/html/
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v1
with:
path: doc/_build/html/

deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 5831
}
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Benedikt Reinartz
Copyright (c) 2019-2022 Benedikt Reinartz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@

[![CI](https://github.com/pythonnet/clr-loader/workflows/Python%20Tests/badge.svg)](https://github.com/pythonnet/clr-loader/actions)
[![Pypi](https://img.shields.io/pypi/v/clr-loader.svg)](https://pypi.org/project/clr-loader/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/clr_loader.svg)](https://anaconda.org/conda-forge/clr_loader)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Implements a generic interface for loading one of the CLR (.NET) runtime implementations and calling simple functions on them.
Implements a generic interface for loading one of the CLR (.NET) runtime
implementations and calling simple functions on them.

Documentation is available at https://pythonnet.github.io/clr-loader/.
Loading