Skip to content

Commit

Permalink
Filter out UP dep install and unit tests for python version less than…
Browse files Browse the repository at this point in the history
… 3.10
  • Loading branch information
fteicht committed Sep 8, 2023
1 parent f3a0e6e commit 587ad93
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ ray = {extras = ["rllib"], version = ">=1.2.0", optional = true}
discrete-optimization = {version = ">=0.2.1", optional = true}
openap = {version = ">=1.3", optional = true}
pygeodesy = {version = ">=23.6.12", optional = true}
unified-planning = {version = ">=1.0.0", optional = true}
up-tamer = {version = ">=1.0.0", optional = true}
up-fast-downward = {version = ">=0.3.0", optional = true}
up-enhsp = {version = ">=0.0.19", optional = true}
up-pyperplan = {version = ">=1.0.0", optional = true}
unified-planning = {version = ">=1.0.0", python = ">=3.10", optional = true}
up-tamer = {version = ">=1.0.0", python = ">=3.10", optional = true}
up-fast-downward = {version = ">=0.3.0", python = ">=3.10", optional = true}
up-enhsp = {version = ">=0.0.19", python = ">=3.10", optional = true}
up-pyperplan = {version = ">=1.0.0", python = ">=3.10", optional = true}

[tool.poetry.extras]
domains = [ "gym", "numpy", "matplotlib", "simplejson", "discrete-optimization", "openap", "pygeodesy", "unified-planning" ]
Expand Down
14 changes: 7 additions & 7 deletions tests/domains/python/test_up_bridge_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import pytest
import sys

import gym
from skdecide.hub.domain.up import UPDomain
from skdecide.hub.solver.lazy_astar import LazyAstar

import unified_planning
from unified_planning.shortcuts import (
Fluent,
InstantaneousAction,
Not,
)


@pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher")
def test_up_bridge_domain():
noexcept = True

try:
import unified_planning
from unified_planning.shortcuts import Fluent, InstantaneousAction, Not

x = Fluent("x")
y = Fluent("y")

Expand Down
28 changes: 17 additions & 11 deletions tests/solvers/python/test_up_bridge_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import pytest
import sys

from skdecide.hub.domain.up import UPDomain, SkUPAction
from skdecide.hub.solver.up import UPSolver

import unified_planning
from unified_planning.shortcuts import (
UserType,
BoolType,
OneshotPlanner,
Fluent,
InstantaneousAction,
Not,
)
from unified_planning.plans import ActionInstance


@pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher")
def test_up_bridge_solver_classic():
noexcept = True

try:
import unified_planning
from unified_planning.shortcuts import UserType, BoolType, OneshotPlanner
from unified_planning.plans import ActionInstance

Location = UserType("Location")
robot_at = unified_planning.model.Fluent("robot_at", BoolType(), l=Location)
connected = unified_planning.model.Fluent(
Expand Down Expand Up @@ -76,10 +73,19 @@ def test_up_bridge_solver_classic():
assert UPSolver.check_domain(domain) and noexcept and step == 9 and p == ep


@pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher")
def test_up_bridge_solver_numeric():
noexcept = True

try:
import unified_planning
from unified_planning.shortcuts import (
OneshotPlanner,
Fluent,
InstantaneousAction,
Not,
)

x = Fluent("x")
y = Fluent("y")

Expand Down

0 comments on commit 587ad93

Please sign in to comment.