Skip to content

Commit

Permalink
use tomllib and update action
Browse files Browse the repository at this point in the history
  • Loading branch information
CagtayFabry committed Apr 30, 2024
1 parent fb588de commit a2f9175
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
steps:
- name: create environment file
run: >
pip3 install tomli packaging pyyaml &&
pip3 install tomli packaging pyyaml --break-system-packages &&
python3 $GITHUB_ACTION_PATH/pydeps2env/generate_environment.py ${{ inputs.files }}
--output ${{ inputs.output }}
--channels ${{ inputs.channels }}
Expand Down
7 changes: 6 additions & 1 deletion pydeps2env/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
from pathlib import Path
from collections import defaultdict
import configparser
import tomli as tomllib
import sys
import yaml
import warnings

if sys.version < "3.11":
import tomli as tomllib
else:
import tomllib


def clean_list(item: list, sort: bool = True) -> list:
"""Remove duplicate entries from a list."""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dynamic = [
dependencies = [
"packaging",
"pyyaml",
"tomli",
'tomli; python_version < "3.11"',
]
[project.optional-dependencies]
test = [
Expand Down

0 comments on commit a2f9175

Please sign in to comment.