Skip to content

Commit 85126ff

Browse files
authored
Merge pull request #8 from softwarepub/cleanup
Cleanup for release
2 parents d01c287 + d64fc73 commit 85126ff

File tree

7 files changed

+17
-59
lines changed

7 files changed

+17
-59
lines changed

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.12"]
17+
python-version: ["3.10"]
1818
steps:
1919
- uses: actions/checkout@v4
2020
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Set up Python 3.12
23+
- name: Set up Python 3.8
2424
uses: actions/setup-python@v3
2525
with:
26-
python-version: "3.12"
26+
python-version: "3.10"
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip

.github/workflows/python-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Python
2525
uses: actions/setup-python@v3
2626
with:
27-
python-version: '3.x'
27+
python-version: '3.10'
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
@@ -35,7 +35,6 @@ jobs:
3535
# Note: the following account information will not work on GHES
3636
git config user.name "github-actions[bot]"
3737
git config user.email ""
38-
python increment_version.py
3938
git add .
4039
git commit -m "generated"
4140
git push origin HEAD:main

.github/workflows/zenodo-sandbox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v2
2323
- uses: actions/setup-python@v4
2424
with:
25-
python-version: '3.12'
25+
python-version: '3.10'
2626
- run: pip install .
2727
- run: git archive --format zip HEAD src > hermes-plugin-python.zip
2828
- run: hermes harvest

increment_version.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ version = "0.1.8"
1414
readme = "README.md"
1515
description = "HERMES plugin for .toml files"
1616
keywords = [ "publishing", "metadata", "automation",]
17-
requires-python = ">= 3.12.4"
17+
requires-python = ">= 3.8"
1818
classifiers = [ "Development Status :: 2 - Pre-Alpha", "Environment :: Plugins", "Programming Language :: Python :: 3", "Operating System :: OS Independent",]
1919
dependencies = [ "hermes>=0.8.0",]
2020
[[project.authors]]

src/hermes_toml/harvest.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

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

10-
from contextlib import chdir
10+
from os import chdir, getcwd
1111
from email.utils import getaddresses
1212

1313
import toml
@@ -28,7 +28,7 @@ class TomlHarvestPlugin(HermesHarvestPlugin):
2828
"project": [
2929
("name", "name"), ("version", "version"), ("description", "description"),
3030
("runtimePlatform", "requires-python"), ("author", "authors"),
31-
("maintainer", "maintainers"), ("keywords", "keywords")
31+
("maintainer", "maintainers"), ("keywords", "keywords"), ("license", "license")
3232
],
3333
"poetry": [
3434
("name", "name"), ("version", "version"), ("description", "description"),
@@ -42,9 +42,13 @@ def __call__(self, command: HermesHarvestCommand):
4242
"""start of the process of harvesting the .toml file"""
4343

4444
#set the working directory temporary to the correct location
45-
with chdir(command.args.path):
46-
#harvesting the data from the .toml file specified in the Settings class
47-
data = self.read_from_toml(command.settings.toml.filename)
45+
old_dir = getcwd()
46+
chdir(command.args.path)
47+
48+
#harvesting the data from the .toml file specified in the Settings class
49+
data = self.read_from_toml(command.settings.toml.filename)
50+
51+
chdir(old_dir)
4852

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

114+
elif field1 == "license":
115+
ret_data[field1] = table[field2].get("text", None)
110116
else:
111117
#add the data of a field that needs no processing
112118
ret_data[field1] = table[field2]

0 commit comments

Comments
 (0)