Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xrotwang committed Aug 14, 2024
1 parent 6143e58 commit 41aa467
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ cldfbench zenodo --communities dplace cldfbench_<id>.py
cldfbench cldfviz.map cldf --pacific-centered --format png --width 20 --output map.png --with-ocean --no-legend
cldfbench readme cldfbench_<id>.py
dplace check cldfbench_<id>.py
git commit -a -m"release vX.Y"
git commit -a -m"release v3.0"
git push origin
dplace release cldfbench_<id>.py v3.0
```

Then create a release on GitHub, thereby pushing the repos to Zenodo.
Expand Down
42 changes: 42 additions & 0 deletions src/pydplace/commands/release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""
"""
from cldfbench.cli_util import add_dataset_spec, get_dataset


def register(parser):
add_dataset_spec(parser)
parser.add_argument('tag')


def run(args): # pragma: no cover
tag = args.tag
if not tag.startswith('v'):
tag = 'v' + tag
ds = get_dataset(args)
cldf = ds.cldf_reader()
if cldf.properties.get('dc:bibliographicCitation'):
relnotes = """\
Cite the source as
> {}
and the D-PLACE dataset as
DOI""".format(cldf.properties['dc:bibliographicCitation'])
else:
relnotes = """\
Cite the D-PLACE dataset as
DOI"""

ds.dir.joinpath('relnotes.txt').write_text(relnotes, encoding='utf8')
print('gh release create {} --title "{}" --notes-file relnotes.txt'.format(
tag, cldf.properties['dc:title']))
print('git pull origin')
print('')
print("Now you should grab the Zenodo version DOI from\n"
"https://zenodo.org/account/settings/github/repository/D-PLACE/{0}\n"
"and add it to\n"
"https://github.com/D-PLACE/{0}/releases/edit/{1}\n and the concept DOI to "
"metdata.json".format(cldf.properties['rdf:ID'], tag))
7 changes: 7 additions & 0 deletions src/pydplace/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ def add_society(self, writer, **props):
)
writer.objects['LanguageTable'].append(props)

def local_makecldf(self, args):
"""
Datasets can hook up any custom processing to happen at the end of the CLDF conversion.
"""
pass

def cmd_makecldf(self, args):
data_schema(args.writer.cldf)
self.schema(args.writer.cldf)
Expand All @@ -309,6 +315,7 @@ def cmd_makecldf(self, args):
comment=row['Comment'],
glottocode_comment=row['glottocode_comment'],
)
self.local_makecldf(args)

def cmd_readme(self, args):
print('gh repo edit --description "{}" --add-topic "ethnology"'.format(self.metadata.title))
Expand Down

0 comments on commit 41aa467

Please sign in to comment.