Skip to content

Commit

Permalink
Add support for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
enekomartinmartinez committed Feb 2, 2024
1 parent e871b8b commit 810708f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
run: |
pip install .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.9', '3.11']
python-version: ['3.9', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sphinx:
build:
os: "ubuntu-22.04"
tools:
python: "3.11"
python: "3.12"

python:
install:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
install_requires=open('requirements.txt').read().strip().split('\n'),
include_package_data=True
Expand Down
2 changes: 2 additions & 0 deletions tests/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
python_files = tests_*.py
filterwarnings =
error
always::DeprecationWarning
always::PendingDeprecationWarning

1 change: 1 addition & 0 deletions tests/tests_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Tests for the argument parser
"""
import subprocess

import pytest

from excels2vensim.cli import parser
Expand Down
14 changes: 7 additions & 7 deletions tests/tests_excels2vensim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import sys
import subprocess
import shutil
from pysd import read_vensim
import numpy as np

import pytest
import numpy as np
from pysd import read_vensim

import excels2vensim as e2v

Expand Down Expand Up @@ -217,19 +217,19 @@ def test_non_valid_chars(tmp_path, _root):
assert "CONSTANTS('inputs_nvc.xlsx', 'Region1', 'my_q_row')" in out

# invalid dim name
with pytest.warns(UserWarning) as records:
with pytest.warns(UserWarning) as record:
out = e2v.load_from_json(_root / 'jsons' / 'constants_nvc.json')

assert len(records) == 2
record = [str(r.message) for r in record]

expected = [
"The name of the subscript '\" Elec/el\"' has special characters. "
+ "'Elec_el' will be used for cellrange names.",
"The name of the subscript '\"Solid$\"' has special characters. "
+ "'Solid' will be used for cellrange names."]

for record in records:
assert record.message.args[0] in expected
for message in expected:
assert message in record

assert "share_energy[source, sector, Region3, \" Elec/el\"]=\n\t"\
+ "GET_DIRECT_CONSTANTS('inputs_nvc.xlsx', 'Region3',"\
Expand All @@ -252,7 +252,7 @@ def test_non_valid_chars(tmp_path, _root):
expected = r"The name of the interpolation dimension 'my time\$'"\
+ r" has special characters\. 'my_time' will be used for "\
+ r"cellrange names\."
with pytest.warns(UserWarning, match=expected) as records:
with pytest.warns(UserWarning, match=expected):
out = e2v.load_from_json(_root / 'jsons' / 'data_nvseries.json')

assert "DATA('inputs_data_nvs.xlsx', 'GPH', 'my_time',"\
Expand Down

0 comments on commit 810708f

Please sign in to comment.