Skip to content

Commit

Permalink
take out github repo link + bump version of cornflowclient
Browse files Browse the repository at this point in the history
  • Loading branch information
pchtsp committed Aug 16, 2024
1 parent 31c5c06 commit 0228868
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cornflow-client-publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
packages_dir: libs/client/dist/
repository-url: https://test.pypi.org/legacy/
packages-dir: libs/client/dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
packages_dir: libs/client/dist/
packages-dir: libs/client/dist/
- name: Get version number
uses: winterjung/split@v2
id: split
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cornflow-publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.CORNFLOW_TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: cornflow-server/dist/
repository-url: https://test.pypi.org/legacy/
packages-dir: cornflow-server/dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.CORNFLOW_PYPI_TOKEN }}
packages_dir: cornflow-server/dist/
packages-dir: cornflow-server/dist/
- name: Get version number
uses: winterjung/split@v2
id: split
Expand Down
1 change: 0 additions & 1 deletion cornflow-dags/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ortools
pyomo
tsplib95<=0.7.1
hackathonbaobab2020[solvers]
git+ssh://[email protected]/baobabsoluciones/windenergybattery.git@main#egg=windenergybattery
networkx

# quarto and reports:
Expand Down
59 changes: 32 additions & 27 deletions cornflow-dags/tests/test_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,36 +209,41 @@ def test_report(self):
)


class WindProblem(BaseDAGTests.SolvingTests):
def setUp(self):
super().setUp()
from DAG.wind_problem import WindEnergyBattery
try:
from DAG.wind_problem import WindEnergyBattery

self.app = WindEnergyBattery()
class WindProblem(BaseDAGTests.SolvingTests):
def setUp(self):
super().setUp()

@patch("cornflow_client.airflow.dag_utilities.connect_to_cornflow")
def test_complete_report(self, connectCornflow, config=None):
config = config or self.config
config = dict(**config, report=dict(name="report"))
tests = self.app.test_cases
for test_case in tests:
instance_data = test_case.get("instance")
solution_data = test_case.get("solution", None)
if solution_data is None:
solution_data = dict(solution_node_values=[])
self.app = WindEnergyBattery()

mock = Mock()
mock.get_data.return_value = dict(
data=instance_data, solution_data=solution_data
)
mock.get_results.return_value = dict(config=config, state=1)
mock.create_report.return_value = dict(id=1)
connectCornflow.return_value = mock
dag_run = Mock()
dag_run.conf = dict(exec_id="exec_id")
cf_report(app=self.app, secrets="", dag_run=dag_run)
mock.create_report.assert_called_once()
mock.put_one_report.assert_called_once()
@patch("cornflow_client.airflow.dag_utilities.connect_to_cornflow")
def test_complete_report(self, connectCornflow, config=None):
config = config or self.config
config = dict(**config, report=dict(name="report"))
tests = self.app.test_cases
for test_case in tests:
instance_data = test_case.get("instance")
solution_data = test_case.get("solution", None)
if solution_data is None:
solution_data = dict(solution_node_values=[])

mock = Mock()
mock.get_data.return_value = dict(
data=instance_data, solution_data=solution_data
)
mock.get_results.return_value = dict(config=config, state=1)
mock.create_report.return_value = dict(id=1)
connectCornflow.return_value = mock
dag_run = Mock()
dag_run.conf = dict(exec_id="exec_id")
cf_report(app=self.app, secrets="", dag_run=dag_run)
mock.create_report.assert_called_once()
mock.put_one_report.assert_called_once()

except ImportError:
pass


class Tsp(BaseDAGTests.SolvingTests):
Expand Down
2 changes: 1 addition & 1 deletion libs/client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setuptools.setup(
name="cornflow-client",
version="1.1.1a2",
version="1.1.1a4",
author="baobab soluciones",
author_email="[email protected]",
description="Client to connect to a cornflow server",
Expand Down

0 comments on commit 0228868

Please sign in to comment.