Skip to content

Commit 455c91a

Browse files
authored
Windows fixes (make test suite pass on windows) (#104)
* Set encoding explicitly for window * Update .gitignore * Fix check for locator to work with windows drive letters * Fix import for Python > 3.9 * Add windows to CI testing * Update poetry.lock * Enforce LF via .gitattributes for .ofn files
1 parent f58ea89 commit 455c91a

File tree

8 files changed

+1824
-507
lines changed

8 files changed

+1824
-507
lines changed

Diff for: .gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Why in oaklib? -> https://github.com/linkml/schema-automator/pull/104#issuecomment-1307388416
2+
# This file may be removed after funowl is fixed to work with platform-specific line endings.
3+
4+
# https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
5+
# Declare files that will always have LF line endings on checkout.
6+
*.ofn text eol=lf

Diff for: .github/workflows/check-pull-request.yaml

+34-22
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,49 @@
22

33
name: Check Pull Request
44

5-
# Controls when the action will run. Triggers the workflow on pull requests.
6-
on: [push, pull_request]
5+
# Controls when the action will run.
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
711

812
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
913
jobs:
1014
# This workflow contains a single job called "build"
1115
build:
12-
runs-on: ubuntu-latest
13-
# The type of runner that the job will run on
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ ubuntu-latest, windows-latest ]
20+
python-version: [ "3.9", "3.10" ]
21+
exclude:
22+
- os: windows-latest
23+
python-version: "3.9"
24+
25+
runs-on: ${{ matrix.os }}
1426

1527
steps:
1628

1729
#----------------------------------------------
18-
# check-out repo and set-up python
30+
# check-out repo and set-up python
1931
#----------------------------------------------
2032
- name: Check out repository
21-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
2234

23-
- name: Set up Python 3.9
24-
uses: actions/setup-python@v2
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v3
2537
with:
26-
python-version: 3.9
27-
38+
python-version: ${{ matrix.python-version }}
39+
2840
#----------------------------------------------
29-
# install & configure poetry
41+
# install & configure poetry
3042
#----------------------------------------------
3143
- name: Install Poetry
32-
uses: snok/install-poetry@v1.1.6
44+
uses: snok/install-poetry@v1.3.1
3345
with:
3446
virtualenvs-create: true
35-
virtualenvs-in-project: true
47+
virtualenvs-in-project: true
3648

3749
# # Install dependencies
3850
# - name: pip Install Dependencies
@@ -41,7 +53,7 @@ jobs:
4153
# pip install -r requirements.txt
4254

4355
#----------------------------------------------
44-
# load cached venv if cache exists
56+
# load cached venv if cache exists
4557
#----------------------------------------------
4658
- name: Load cached venv
4759
id: cached-poetry-dependencies
@@ -51,26 +63,26 @@ jobs:
5163
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
5264

5365
#----------------------------------------------
54-
# install dependencies if cache does not exist
66+
# install dependencies if cache does not exist
5567
#----------------------------------------------
5668
- name: Install dependencies
5769
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
5870
run: poetry install --no-interaction --no-root
59-
71+
72+
#----------------------------------------------
73+
# install your root project, if required
6074
#----------------------------------------------
61-
# install your root project, if required
62-
#----------------------------------------------
6375
- name: Install library
6476
run: poetry install --no-interaction
65-
77+
6678
# - name: Run image
6779
# uses: abatilo/[email protected]
6880
# # with:
6981
# # poetry-version: ${{ matrix.poetry-version }}
7082
# - name: View poetry --help
7183
# run: poetry --help
7284

73-
# Make test
74-
- name: Make test
85+
- name: Run test suite
7586
run: |
76-
make test
87+
poetry run pip install -U pytest
88+
poetry run pytest tests/

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ __pycache__
1212
*.pyc
1313
tests/outputs/*
1414
venv/
15+
.venv/
1516
target/
1617
local/

0 commit comments

Comments
 (0)