Skip to content

Commit

Permalink
improve CI, make test=True in grid2Op env in test
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Feb 21, 2024
1 parent 0280ed8 commit b05be42
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 4 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Test Python Package

on:
push:
branches:
- '*'
tags:
- 'v*.*.*'

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Install built package
run: |
pip install tensorflow
find dist/ -name leap_net\*.whl -type f -exec pip install {}[test] \;
# If you install TensorFlow, critically, you should reinstall Keras 3 afterwards.
# This is a temporary step while TensorFlow is pinned to Keras 2, and will no
# longer be necessary after TensorFlow 2.16. The cause is that tensorflow==2.15
# will overwrite your Keras installation with keras==2.15.
- name: test package
run: |
cd leap_net/test
python -m unittest discover
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ perf.data.old
test_profile.py
test_profile.py.lprof
test_mapequantile.py

venv_test/
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
===========

[0.1.2] - 202x-yy-zz
--------------------
- [ADDED] a file to make tests on push
- [IMPROVED] "test=True" is added in all the environment in the CI

[0.1.1] - 2024-02-21
--------------------
- [FIXED] Broken tests
Expand Down
2 changes: 1 addition & 1 deletion leap_net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SPDX-License-Identifier: MPL-2.0
# This file is part of leap_net, leap_net a keras implementation of the LEAP Net model.

__version__ = "0.1.1"
__version__ = "0.1.2.dev0"
__all__ = []

try:
Expand Down
2 changes: 1 addition & 1 deletion leap_net/test/test_Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUp(self) -> None:
param.NB_TIMESTEP_COOLDOWN_LINE = 0
param.NB_TIMESTEP_COOLDOWN_SUB = 0

self.env = grid2op.make("l2rpn_case14_sandbox", param=param)
self.env = grid2op.make("l2rpn_case14_sandbox", test=True, param=param)
self.obs = self.env.reset()

def test_RandomSub1(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
long_description = fh.read()

setup(name='leap_net',
version='0.1.1',
version='0.1.2.dev0',
description='An implementation in keras 3.0 (and tensorflow keras) of the LeapNet model',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit b05be42

Please sign in to comment.