Skip to content

Commit 46156cb

Browse files
authored
Merge pull request #324 from clamsproject/develop
releasing 1.1.1
2 parents 093531d + 39f39e6 commit 46156cb

File tree

4 files changed

+36
-119
lines changed

4 files changed

+36
-119
lines changed

.github/workflows/codecov.yml

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,8 @@ on:
1717
default: "develop"
1818

1919
jobs:
20-
test:
21-
name: "🧪 Test with coverage"
22-
runs-on: ubuntu-latest
23-
strategy:
24-
matrix:
25-
python-version: ["3.11", "3.10"]
26-
env:
27-
OS: linux
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
steps:
30-
- name: "🛍️ Checkout repository"
31-
uses: actions/checkout@v4
32-
with:
33-
ref: ${{ github.event.inputs.branch || github.ref }}
34-
- name: "🐍 Setup Python"
35-
uses: actions/setup-python@v4
36-
with:
37-
python-version: ${{ matrix.python-version }}
38-
- name: "🧪 Run test and generate coverage report"
39-
working-directory: .
40-
run: |
41-
echo "codecov.dev" > VERSION
42-
make test
43-
- name: "📦 Upload coverage artifact"
44-
uses: actions/upload-artifact@v4
45-
with:
46-
name: coverage-report-${{ matrix.python-version }}
47-
path: ./coverage.xml
48-
49-
upload:
50-
name: "☁️ Upload coverage to Codecov"
51-
runs-on: ubuntu-latest
52-
needs: test
53-
steps:
54-
- name: "🛍️ Checkout repository"
55-
uses: actions/checkout@v4
56-
with:
57-
ref: ${{ github.event.inputs.branch || github.ref }}
58-
- name: "📥 Download coverage artifact"
59-
uses: actions/download-artifact@v4
60-
with:
61-
name: coverage-report-3.10
62-
- name: "☁️ Upload coverage to Codecov"
63-
uses: codecov/codecov-action@v3
64-
with:
65-
token: ${{ secrets.CODECOV_UPLOAD_TOKEN_MMIF_PYTHON }}
66-
files: ./coverage.xml
67-
flags: unittests
68-
env_vars: OS,PYTHON
69-
name: coverage
70-
fail_ci_if_error: true
71-
20+
test-and-codecov:
21+
name: "🤙 Call SDK test workflow"
22+
uses: clamsproject/.github/.github/workflows/sdk-codecov.yml@main
23+
secrets:
24+
CC_REPO_UPLOAD_TOKEN: ${{ secrets.CODECOV_UPLOAD_TOKEN_MMIF_PYTHON }}

.github/workflows/publish.yml

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,7 @@ on:
66
- '[0-9]+.[0-9]+.[0-9]+'
77

88
jobs:
9-
build-and-upload:
10-
name: "📦 Upload documentation, PyPI distribution"
11-
runs-on: ubuntu-latest
12-
env:
13-
OS: linux
14-
PYTHON: '3.10'
15-
steps:
16-
- name: "🏷 Prepare package metadata"
17-
run: |
18-
echo "VERSION=$(echo "${{ github.ref }}" | cut -d/ -f3)" >> $GITHUB_ENV
19-
echo "PACKAGE=$(echo "${{ github.repository }}" | cut -d/ -f2 | tr '-' '_')" >> $GITHUB_ENV
20-
- name: "🛍 Checkout repository"
21-
uses: actions/checkout@v4
22-
with:
23-
ref: ${{ env.VERSION }}
24-
fetch-depth: 0
25-
token: ${{ secrets.GITHUB_TOKEN }}
26-
- name: "🐍 Setup Python"
27-
uses: actions/setup-python@v4
28-
with:
29-
python-version: '3.10'
30-
- name: "🏗 Build sdist"
31-
run: |
32-
echo ${{ env.VERSION }} > VERSION
33-
python3 -c "import setuptools; print(setuptools.__version__)"
34-
python3 -m pip install setuptools~=69.3 # this version fully conforms PEP-625 and applies wheel name convention to sdist as well
35-
make package
36-
make test
37-
- name: "🗞️ Build HTML documentation"
38-
run: |
39-
make docs
40-
- name: "📓 Generate changelog"
41-
run: |
42-
for pr in $(gh pr list -L 1000 -s merged | grep -E "^[0-9]+\s+releas" | cut -f 1 ); do gh pr view $pr --json title,body,mergedAt --template '{{printf "\n"}}## {{.title}} ({{timefmt "2006-01-02" .mergedAt}}){{printf "\n"}}{{.body}}{{printf "\n"}}'; done > CHANGELOG.md
43-
env:
44-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
- name: "🫙 Commit and push documentation files"
46-
run: |
47-
git config --local user.email "admin@clams.ai"
48-
git config --local user.name "clams-bot"
49-
for f in docs documentation CHANGELOG.md; do if [ -e $f ]; then git add $f; fi; done
50-
git add -u docs
51-
git commit -m 'adding HTML documentation for publication'
52-
git push origin HEAD:main
53-
- name: "☁️ Upload to PyPI"
54-
run: |
55-
if [ -d dist ]; then twine upload -u __token__ -p ${{ secrets.PYPITOKEN }} dist/${{ env.PACKAGE }}-${{ env.VERSION }}.tar.gz ; fi
9+
package-and-upload:
10+
name: "🤙 Call SDK publish workflow"
11+
uses: clamsproject/.github/.github/workflows/sdk-publish.yml@main
12+
secrets: inherit

requirements.dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ sphinx-autobuild
1313
git+https://github.com/clamsproject/sphinx-multiversion.git@master
1414
twine
1515
m2r2
16+
setuptools>=70 # arbitrarily recent version

setup.py

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from urllib import request
1212

1313
import setuptools.command.build_py
14-
import setuptools.command.develop
14+
from setuptools.command.sdist import sdist
15+
from setuptools.command.develop import develop
1516

1617
name = "mmif-python"
1718
version_fname = "VERSION"
@@ -254,15 +255,18 @@ def mod_run(self):
254255
return setuptools_cmd
255256

256257

258+
# Modernize cmdclass to ensure compatibility with setuptools >=80
257259
@prep_ext_files
258-
class SdistCommand(setuptools.command.sdist.sdist):
259-
pass
260-
260+
class SdistCommand(sdist):
261+
def initialize_options(self):
262+
super().initialize_options()
263+
# Add any additional initialization logic here if needed
261264

262265
@prep_ext_files
263-
class DevelopCommand(setuptools.command.develop.develop):
264-
pass
265-
266+
class DevelopCommand(develop):
267+
def initialize_options(self):
268+
super().initialize_options()
269+
# Add any additional initialization logic here if needed
266270

267271
cmdclass['sdist'] = SdistCommand
268272
cmdclass['develop'] = DevelopCommand
@@ -279,6 +283,17 @@ class DevelopCommand(setuptools.command.develop.develop):
279283
with open('requirements.seq') as requirements:
280284
seq_requires = requirements.readlines()
281285

286+
extras_require = {
287+
'seq': seq_requires,
288+
'cv': cv_requires,
289+
'dev': [
290+
'pytest',
291+
'pytest-pep8',
292+
'pytest-cov',
293+
'pytype',
294+
]
295+
}
296+
282297
setuptools.setup(
283298
name=name,
284299
version=version,
@@ -301,21 +316,12 @@ class DevelopCommand(setuptools.command.develop.develop):
301316
'mmif': [f'{mmif_res_pkg}/*', f'{mmif_ver_pkg}/*', f'{mmif_vocabulary_pkg}/*'],
302317
},
303318
install_requires=requires,
304-
extras_require={
305-
'seq': seq_requires,
306-
'cv': cv_requires,
307-
'dev': [
308-
'pytest',
309-
'pytest-pep8',
310-
'pytest-cov',
311-
'pytype',
312-
]
313-
},
319+
extras_require=extras_require,
314320
python_requires='>=3.10',
315321
classifiers=[
316-
'Development Status :: 2 - Pre-Alpha',
317-
'Intended Audience :: Developers ',
318-
'License :: OSI Approved :: Apache Software License',
322+
'Development Status :: 5 - Production/Stable',
323+
'Intended Audience :: Developers',
324+
'License :: Apache-2.0',
319325
'Programming Language :: Python :: 3 :: Only',
320326
]
321327
)

0 commit comments

Comments
 (0)