Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: "3.12"
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -35,7 +35,6 @@ jobs:
# Note: the following account information will not work on GHES
git config user.name "github-actions[bot]"
git config user.email ""
python increment_version.py
git add .
git commit -m "generated"
git push origin HEAD:main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zenodo-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.12'
python-version: '3.10'
- run: pip install .
- run: git archive --format zip HEAD src > hermes-plugin-python.zip
- run: hermes harvest
Expand Down
47 changes: 0 additions & 47 deletions increment_version.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version = "0.1.8"
readme = "README.md"
description = "HERMES plugin for .toml files"
keywords = [ "publishing", "metadata", "automation",]
requires-python = ">= 3.12.4"
requires-python = ">= 3.8"
classifiers = [ "Development Status :: 2 - Pre-Alpha", "Environment :: Plugins", "Programming Language :: Python :: 3", "Operating System :: OS Independent",]
dependencies = [ "hermes>=0.8.0",]
[[project.authors]]
Expand Down
16 changes: 11 additions & 5 deletions src/hermes_toml/harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"""A hermes harvest plugin that harvests the .toml file of the project"""

from contextlib import chdir
from os import chdir, getcwd
from email.utils import getaddresses

import toml
Expand All @@ -28,7 +28,7 @@ class TomlHarvestPlugin(HermesHarvestPlugin):
"project": [
("name", "name"), ("version", "version"), ("description", "description"),
("runtimePlatform", "requires-python"), ("author", "authors"),
("maintainer", "maintainers"), ("keywords", "keywords")
("maintainer", "maintainers"), ("keywords", "keywords"), ("license", "license")
],
"poetry": [
("name", "name"), ("version", "version"), ("description", "description"),
Expand All @@ -42,9 +42,13 @@ def __call__(self, command: HermesHarvestCommand):
"""start of the process of harvesting the .toml file"""

#set the working directory temporary to the correct location
with chdir(command.args.path):
#harvesting the data from the .toml file specified in the Settings class
data = self.read_from_toml(command.settings.toml.filename)
old_dir = getcwd()
chdir(command.args.path)

#harvesting the data from the .toml file specified in the Settings class
data = self.read_from_toml(command.settings.toml.filename)

chdir(old_dir)

#returning the harvested data and some metadata
return data, {"filename": command.settings.toml.filename}
Expand Down Expand Up @@ -107,6 +111,8 @@ def read_from_one_table(cls, table, mapping):
if not persons is None:
ret_data[field1] = persons

elif field1 == "license":
ret_data[field1] = table[field2].get("text", None)
else:
#add the data of a field that needs no processing
ret_data[field1] = table[field2]
Expand Down