Skip to content

Commit 3a2f4cb

Browse files
authored
Merge pull request #1 from Mng-dev-ai/Fix-Ci
Fix CI
2 parents 837bfd3 + ea7b13a commit 3a2f4cb

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.github/workflows/CI.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,25 @@ jobs:
5656

5757
# Pytest
5858
test:
59-
runs-on: ubuntu-latest
59+
runs-on: ubuntu-20.04
6060
strategy:
6161
matrix:
62-
python-version: [3.7, 3.8, 3.9, 3.10]
63-
62+
python-version: [3.7, 3.8, 3.9, "3.10.12"]
63+
6464
steps:
6565
- name: Checkout sources
6666
uses: actions/checkout@v2
6767

6868
- name: Set up Python
69-
uses: actions/setup-python@v2
69+
uses: actions/setup-python@v4
7070
with:
7171
python-version: ${{ matrix.python-version }}
7272

73+
- name: Create and activate virtual environment
74+
run: |
75+
python -m venv .venv
76+
echo ".venv/bin" >> $GITHUB_PATH
77+
7378
- name: Install Rust
7479
uses: actions-rs/toolchain@v1
7580
with:
@@ -81,11 +86,16 @@ jobs:
8186
run: cargo install maturin
8287

8388
- name: Build and Install Python Package
84-
run: maturin develop --release
89+
run: |
90+
source .venv/bin/activate
91+
maturin develop --release
8592
8693
- name: Install pytest
87-
run: pip install pytest
94+
run: |
95+
source .venv/bin/activate
96+
pip install pytest
8897
8998
- name: Run pytest
90-
run: pytest tests
91-
99+
run: |
100+
source .venv/bin/activate
101+
pytest tests

bench/run.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import _drf
77
import _marshmallow
88
import _schemars
9-
import _pydantic
109

1110

1211
def random_string(length=5):
@@ -52,9 +51,7 @@ def __init__(self, middle, field4):
5251
marshmallow_schema = _marshmallow.OuterSchema()
5352
start_time = time.time()
5453
serialized_data = marshmallow_schema.dump(instances, many=True)
55-
print(
56-
f"--- Marshmallow Serialization took {time.time() - start_time} seconds ---"
57-
)
54+
print(f"--- Marshmallow Serialization took {time.time() - start_time} seconds ---")
5855

5956
serializer = _drf.OuterSerializer(instances, many=True)
6057
start_time = time.time()
@@ -64,6 +61,4 @@ def __init__(self, middle, field4):
6461
schemars_schema = _schemars.OuterSchema()
6562
start_time = time.time()
6663
serialized_data = [schemars_schema.serialize(instance) for instance in instances]
67-
print(
68-
f"--- Schemars Serialization took {time.time() - start_time} seconds ---"
69-
)
64+
print(f"--- Schemars Serialization took {time.time() - start_time} seconds ---")

0 commit comments

Comments
 (0)