Skip to content

Commit 6ddb11b

Browse files
authored
MAINT: Prep for 0.8.1 (#65)
1 parent f8c0fec commit 6ddb11b

7 files changed

Lines changed: 86 additions & 8 deletions

File tree

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"
11+
labels:
12+
- no-changelog-entry-needed
13+
cooldown:
14+
default-days: 7

.github/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- dependabot[bot]
5+
- pre-commit-ci[bot]

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Upload a Python Package using Twine when a release is created
2+
3+
name: Build
4+
on: # yamllint disable-line rule:truthy
5+
release:
6+
types: [published]
7+
push:
8+
branches: ["master", "maint/*"]
9+
pull_request:
10+
branches: ["master", "maint/*"]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
package:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
with:
21+
persist-credentials: false
22+
- uses: actions/setup-python@v6
23+
with:
24+
python-version: '3.10'
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine pillow
29+
- run: python -m build --sdist --wheel
30+
- run: twine check --strict dist/*
31+
- uses: actions/upload-artifact@v5
32+
with:
33+
name: dist
34+
path: dist
35+
36+
pypi-upload:
37+
needs: package
38+
runs-on: ubuntu-latest
39+
if: github.event_name == 'release'
40+
permissions:
41+
id-token: write # for trusted publishing
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/python-picard
45+
steps:
46+
- uses: actions/download-artifact@v6
47+
with:
48+
name: dist
49+
path: dist
50+
- uses: pypa/gh-action-pypi-publish@release/v1
51+
if: github.event_name == 'release'

.github/workflows/unittests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
pull_request:
44
push:
55
branches: master
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
8+
cancel-in-progress: true
69

710
jobs:
811
test:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ picard.egg-info/
2525
.tags
2626
tags
2727
.coverage
28+
python_picard.egg-info/

picard/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Dev branch marker is: 'X.Y.devN' where N is an integer.
1717
#
1818

19-
__version__ = '0.9.dev'
19+
__version__ = '0.8.1'
2020

2121
from .solver import picard # noqa
2222
from ._tools import permute, amari_distance # noqa

setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#! /usr/bin/env python
22

33
import os
4-
import setuptools # noqa; we are using a setuptools namespace
4+
import re
5+
from pathlib import Path
6+
57
from setuptools import setup
68

79

810
descr = """Preconditoned ICA for Real Data"""
911

1012
version = None
11-
with open(os.path.join('picard', '__init__.py'), 'r') as fid:
12-
for line in (line.strip() for line in fid):
13-
if line.startswith('__version__'):
14-
version = line.split('=')[1].strip().strip('\'')
15-
break
13+
for line in (Path('picard') / '__init__.py').read_text("utf-8").splitlines():
14+
if line.startswith('__version__'):
15+
version = line.split('=')[1].strip().strip('\'')
16+
break
1617
if version is None:
1718
raise RuntimeError('Could not determine version')
1819

@@ -38,6 +39,9 @@ def package_tree(pkgroot):
3839

3940

4041
if __name__ == "__main__":
42+
long_description = Path('README.rst').read_text("utf-8")
43+
# Remove scale for PyPI
44+
long_description = re.sub(r"\s+:scale:.*\n", "\n", long_description)
4145
setup(name=DISTNAME,
4246
maintainer=MAINTAINER,
4347
maintainer_email=MAINTAINER_EMAIL,
@@ -46,7 +50,7 @@ def package_tree(pkgroot):
4650
version=VERSION,
4751
url=URL,
4852
download_url=DOWNLOAD_URL,
49-
long_description=open('README.rst').read(),
53+
long_description=long_description,
5054
long_description_content_type='text/x-rst',
5155
classifiers=['Intended Audience :: Science/Research',
5256
'Intended Audience :: Developers',

0 commit comments

Comments
 (0)