Skip to content

Commit

Permalink
Merge pull request #125 from AllenNeuralDynamics/cdci-uv-as-package-m…
Browse files Browse the repository at this point in the history
…anager

Add support of uv package manager
  • Loading branch information
bruno-f-cruz authored Nov 17, 2024
2 parents b4ec031 + 2efba2c commit d8c7207
Show file tree
Hide file tree
Showing 29 changed files with 1,241 additions and 44 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,40 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
linters:
runs-on: windows-latest
name: Lint ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v3
with:
python-version: "3.11"
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .[linters] --no-cache-dir
run: uv sync --extra dev
- name: Run ruff format
run: ruff format . --config .\pyproject.toml
run: uv run ruff format . --config .\pyproject.toml
- name: Run ruff check
run: ruff check . --config .\pyproject.toml
run: uv run ruff check . --config .\pyproject.toml
- name: Run codespell
run : codespell .
run : uv run codespell .

tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET Core SDK
uses: actions/[email protected]
Expand All @@ -39,18 +49,18 @@ jobs:
working-directory: bonsai
run: .\Setup.ps1

- name: Set up Python
uses: actions/setup-python@v3
- uses: astral-sh/setup-uv@v3
with:
python-version: '3.11'
enable-cache: true
- name: Set up Python
run: uv python install

- name: Install dependencies
run: |
python -m pip install -e . --no-cache-dir
run: uv sync --extra dev
- name: Run tests
run: python -m unittest
run: uv run -m unittest
- name: Regenerate schemas
run: regenerate
run: uv run regenerate
- name: Check for uncommitted changes
run: |
git config --global core.safecrlf false
Expand Down
3 changes: 3 additions & 0 deletions .python-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
3.11
3.12
3.13
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.Services/relea

[project.optional-dependencies]

linters = [
dev = [
'ruff',
'codespell'
]
Expand Down Expand Up @@ -73,5 +73,5 @@ mccabe = { max-complexity = 14 }
pydocstyle = { convention = 'google' }

[tool.codespell]
skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build'
skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build,uv.lock'
ignore-words-list = 'nd'
1 change: 1 addition & 0 deletions scripts/install_dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ winget install -e --id Nvidia.GeForceExperience -v 3.26.0.160 @autoaccept
winget install -e --id Nvidia.CUDA -v 11.3 @autoaccept
winget install -e --id Notepad++.Notepad++ @autoaccept
winget install --id=Microsoft.DotNet.SDK.8 -e @autoaccept
winget install --id=astral-sh.uv -e @autoaccept

## Install dotnet tools

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/AindBehaviorSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace AindBehaviorServices.AindBehaviorSession
public partial class AindBehaviorSessionModel
{

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private string _version = "0.3.0";

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/AindManipulatorCalibrationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class CalibrationParameters

private double? _rngSeed;

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

public CalibrationParameters()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/AindManipulatorCalibrationRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ public enum MotorOperationMode
public partial class CalibrationRig
{

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private string _version = "0.1.0";

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/LoadCellsCalibrationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class CalibrationParameters

private double? _rngSeed;

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private System.Collections.Generic.List<int> _channels = new System.Collections.Generic.List<int>();

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/LoadCellsCalibrationRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ public override string ToString()
public partial class CalibrationRig
{

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private string _version = "0.0.0";

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/OlfactometerCalibrationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class CalibrationParameters

private double? _rngSeed;

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private System.Collections.Generic.IDictionary<string, OlfactometerChannelConfig> _channelConfig;

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/OlfactometerCalibrationRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ public enum OlfactometerChannelType
public partial class CalibrationRig
{

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private string _version = "0.0.0";

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/TreadmillCalibrationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class CalibrationParameters

private double? _rngSeed;

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

public CalibrationParameters()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/TreadmillCalibrationRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public override string ToString()
public partial class CalibrationRig
{

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private string _version = "0.0.0";

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/WaterValveCalibrationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class CalibrationParameters

private double? _rngSeed;

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private System.Collections.Generic.List<double> _valveOpenTime = new System.Collections.Generic.List<double>();

Expand Down
2 changes: 1 addition & 1 deletion src/Extensions/WaterValveCalibrationRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace AindBehaviorServices.WaterValveCalibrationRig
public partial class CalibrationRig
{

private string _aindBehaviorServicesPkgVersion = "0.8.7";
private string _aindBehaviorServicesPkgVersion = "0.8.8";

private string _version = "0.0.0";

Expand Down
2 changes: 1 addition & 1 deletion src/schemas/aind_behavior_data_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
},
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/aind_behavior_session.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/aind_behavior_subject_database.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/aind_manipulator_calibration_logic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/aind_manipulator_calibration_rig.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
},
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/load_cells_calibration_logic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/load_cells_calibration_rig.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
},
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/olfactometer_calibration_logic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/olfactometer_calibration_rig.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
},
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions src/schemas/treadmill_calibration_logic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down Expand Up @@ -45,7 +45,7 @@
"$ref": "#/definitions/CalibrationParameters",
"default": {
"rng_seed": null,
"aind_behavior_services_pkg_version": "0.8.7"
"aind_behavior_services_pkg_version": "0.8.8"
},
"title": "Task parameters"
},
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/treadmill_calibration_rig.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
},
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/water_valve_calibration_logic.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"title": "Rng Seed"
},
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/water_valve_calibration_rig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"properties": {
"aind_behavior_services_pkg_version": {
"default": "0.8.7",
"default": "0.8.8",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"title": "aind_behavior_services package version",
"type": "string"
Expand Down
Loading

0 comments on commit d8c7207

Please sign in to comment.