Skip to content

Commit e1bd807

Browse files
committed
Merge branch 'develop'
* develop: Update CHANGELOG.md Modernize python packaging (#851) Make s3.SinglepartWriter seekable (#854) Fix try-except in ssh.py for missing port in ssh config (#863) Fix integration test CI rot (#864) Add buffer_size transport param to ssh.py (#861) Add help.txt linting step (#853) Remove head_bucket call from s3.SinglepartWriter (#857) bump version to 7.2.0.dev0
2 parents a08f0a0 + 357e4d7 commit e1bd807

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+761
-686
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Fixes #{issue_number}
2525
> Make sure all existing unit tests pass.
2626
> You can run them locally using:
2727
>
28-
> pytest smart_open
28+
> pytest tests
2929
>
3030
> If there are any failures, please fix them before creating the PR (or mark it as WIP, see below).
3131
@@ -45,6 +45,7 @@ Fixes #{issue_number}
4545
- [ ] Clearly explained the motivation behind the PR
4646
- [ ] Linked to any existing issues that your PR will be solving
4747
- [ ] Included tests for any new functionality
48+
- [ ] Run `python update_helptext.py` in case there are API changes
4849
- [ ] Checked that all unit tests pass
4950

5051
### Workflow

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
groups:
8+
github-actions:
9+
patterns:
10+
- '*'

.github/workflows/python-package.yml

Lines changed: 85 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,62 @@
1-
name: Test
2-
on: [push, pull_request]
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master, develop]
6+
workflow_dispatch: # allows running CI manually from the Actions tab
37
concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109
48
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
59
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
610
jobs:
711
linters:
8-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
913
steps:
10-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__)
1117

1218
- name: Setup up Python 3.11
13-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
1420
with:
1521
python-version: "3.11"
1622

1723
- name: Install dependencies
18-
run: pip install flake8
24+
run: pip install flake8 -e .[all]
1925

2026
- name: Run flake8 linter (source)
2127
run: flake8 --show-source smart_open
2228

29+
- name: "Check whether help.txt update was forgotten"
30+
if: github.event_name == 'pull_request'
31+
run: |
32+
python update_helptext.py
33+
test ! "$(git diff)" && echo "no changes" || ( git diff && echo 'looks like "python update_helptext.py" was forgotten' && exit 1 )
34+
2335
unit_tests:
2436
needs: [linters]
2537
runs-on: ${{ matrix.os }}
2638
strategy:
2739
matrix:
2840
include:
29-
- {python-version: '3.8', os: ubuntu-20.04}
30-
- {python-version: '3.9', os: ubuntu-20.04}
31-
- {python-version: '3.10', os: ubuntu-20.04}
32-
- {python-version: '3.11', os: ubuntu-20.04}
33-
- {python-version: '3.12', os: ubuntu-20.04}
34-
- {python-version: '3.13', os: ubuntu-20.04}
35-
36-
- {python-version: '3.8', os: windows-2019}
37-
- {python-version: '3.9', os: windows-2019}
38-
- {python-version: '3.10', os: windows-2019}
39-
- {python-version: '3.11', os: windows-2019}
40-
- {python-version: '3.12', os: windows-2019}
41-
- {python-version: '3.13', os: windows-2019}
41+
- {python-version: '3.8', os: ubuntu-24.04}
42+
- {python-version: '3.9', os: ubuntu-24.04}
43+
- {python-version: '3.10', os: ubuntu-24.04}
44+
- {python-version: '3.11', os: ubuntu-24.04}
45+
- {python-version: '3.12', os: ubuntu-24.04}
46+
- {python-version: '3.13', os: ubuntu-24.04}
47+
48+
- {python-version: '3.8', os: windows-2025}
49+
- {python-version: '3.9', os: windows-2025}
50+
- {python-version: '3.10', os: windows-2025}
51+
- {python-version: '3.11', os: windows-2025}
52+
- {python-version: '3.12', os: windows-2025}
53+
- {python-version: '3.13', os: windows-2025}
4254
steps:
43-
- uses: actions/checkout@v2
55+
- uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__)
4458

45-
- uses: actions/setup-python@v2
59+
- uses: actions/setup-python@v5
4660
with:
4761
python-version: ${{ matrix.python-version }}
4862

@@ -56,37 +70,38 @@ jobs:
5670
run: pip install -e .[test]
5771

5872
- name: Run unit tests
59-
run: pytest smart_open -v -rfxECs --durations=20
73+
run: pytest tests -v -rfxECs --durations=20
6074

6175
doctest:
6276
needs: [linters,unit_tests]
6377
runs-on: ${{ matrix.os }}
6478
strategy:
6579
matrix:
6680
include:
67-
- {python-version: '3.8', os: ubuntu-20.04}
68-
- {python-version: '3.9', os: ubuntu-20.04}
69-
- {python-version: '3.10', os: ubuntu-20.04}
70-
- {python-version: '3.11', os: ubuntu-20.04}
71-
- {python-version: '3.12', os: ubuntu-20.04}
72-
- {python-version: '3.13', os: ubuntu-20.04}
81+
- {python-version: '3.8', os: ubuntu-24.04}
82+
- {python-version: '3.9', os: ubuntu-24.04}
83+
- {python-version: '3.10', os: ubuntu-24.04}
84+
- {python-version: '3.11', os: ubuntu-24.04}
85+
- {python-version: '3.12', os: ubuntu-24.04}
86+
- {python-version: '3.13', os: ubuntu-24.04}
7387

7488
#
7589
# Some of the doctests don't pass on Windows because of Windows-specific
7690
# character encoding issues.
7791
#
78-
# - {python-version: '3.7', os: windows-2019}
79-
# - {python-version: '3.8', os: windows-2019}
80-
# - {python-version: '3.9', os: windows-2019}
81-
# - {python-version: '3.10', os: windows-2019}
82-
# - {python-version: '3.11', os: windows-2019}
83-
# - {python-version: '3.12', os: windows-2019}
84-
# - {python-version: '3.13', os: windows-2019}
92+
# - {python-version: '3.8', os: windows-2025}
93+
# - {python-version: '3.9', os: windows-2025}
94+
# - {python-version: '3.10', os: windows-2025}
95+
# - {python-version: '3.11', os: windows-2025}
96+
# - {python-version: '3.12', os: windows-2025}
97+
# - {python-version: '3.13', os: windows-2025}
8598

8699
steps:
87-
- uses: actions/checkout@v2
100+
- uses: actions/checkout@v4
101+
with:
102+
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__)
88103

89-
- uses: actions/setup-python@v2
104+
- uses: actions/setup-python@v5
90105
with:
91106
python-version: ${{ matrix.python-version }}
92107

@@ -105,27 +120,28 @@ jobs:
105120
strategy:
106121
matrix:
107122
include:
108-
- {python-version: '3.8', os: ubuntu-20.04}
109-
- {python-version: '3.9', os: ubuntu-20.04}
110-
- {python-version: '3.10', os: ubuntu-20.04}
111-
- {python-version: '3.11', os: ubuntu-20.04}
112-
- {python-version: '3.12', os: ubuntu-20.04}
113-
- {python-version: '3.13', os: ubuntu-20.04}
123+
- {python-version: '3.8', os: ubuntu-24.04}
124+
- {python-version: '3.9', os: ubuntu-24.04}
125+
- {python-version: '3.10', os: ubuntu-24.04}
126+
- {python-version: '3.11', os: ubuntu-24.04}
127+
- {python-version: '3.12', os: ubuntu-24.04}
128+
- {python-version: '3.13', os: ubuntu-24.04}
114129

115130
# Not sure why we exclude these, perhaps for historical reasons?
116131
#
117-
# - {python-version: '3.7', os: windows-2019}
118-
# - {python-version: '3.8', os: windows-2019}
119-
# - {python-version: '3.9', os: windows-2019}
120-
# - {python-version: '3.10', os: windows-2019}
121-
# - {python-version: '3.11', os: windows-2019}
122-
# - {python-version: '3.12', os: windows-2019}
123-
# - {python-version: '3.13', os: windows-2019}
132+
# - {python-version: '3.8', os: windows-2025}
133+
# - {python-version: '3.9', os: windows-2025}
134+
# - {python-version: '3.10', os: windows-2025}
135+
# - {python-version: '3.11', os: windows-2025}
136+
# - {python-version: '3.12', os: windows-2025}
137+
# - {python-version: '3.13', os: windows-2025}
124138

125139
steps:
126-
- uses: actions/checkout@v2
140+
- uses: actions/checkout@v4
141+
with:
142+
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__)
127143

128-
- uses: actions/setup-python@v2
144+
- uses: actions/setup-python@v5
129145
with:
130146
python-version: ${{ matrix.python-version }}
131147

@@ -158,25 +174,26 @@ jobs:
158174
strategy:
159175
matrix:
160176
include:
161-
- {python-version: '3.8', os: ubuntu-20.04}
162-
- {python-version: '3.9', os: ubuntu-20.04}
163-
- {python-version: '3.10', os: ubuntu-20.04}
164-
- {python-version: '3.11', os: ubuntu-20.04}
165-
- {python-version: '3.12', os: ubuntu-20.04}
166-
- {python-version: '3.13', os: ubuntu-20.04}
167-
168-
# - {python-version: '3.7', os: windows-2019}
169-
# - {python-version: '3.8', os: windows-2019}
170-
# - {python-version: '3.9', os: windows-2019}
171-
# - {python-version: '3.10', os: windows-2019}
172-
# - {python-version: '3.11', os: windows-2019}
173-
# - {python-version: '3.12', os: windows-2019}
174-
# - {python-version: '3.13', os: windows-2019}
177+
- {python-version: '3.8', os: ubuntu-24.04}
178+
- {python-version: '3.9', os: ubuntu-24.04}
179+
- {python-version: '3.10', os: ubuntu-24.04}
180+
- {python-version: '3.11', os: ubuntu-24.04}
181+
- {python-version: '3.12', os: ubuntu-24.04}
182+
- {python-version: '3.13', os: ubuntu-24.04}
183+
184+
# - {python-version: '3.8', os: windows-2025}
185+
# - {python-version: '3.9', os: windows-2025}
186+
# - {python-version: '3.10', os: windows-2025}
187+
# - {python-version: '3.11', os: windows-2025}
188+
# - {python-version: '3.12', os: windows-2025}
189+
# - {python-version: '3.13', os: windows-2025}
175190

176191
steps:
177-
- uses: actions/checkout@v2
192+
- uses: actions/checkout@v4
193+
with:
194+
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__)
178195

179-
- uses: actions/setup-python@v2
196+
- uses: actions/setup-python@v5
180197
with:
181198
python-version: ${{ matrix.python-version }}
182199

.github/workflows/release.yml

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
11
name: Release to PyPI
22

33
on:
4-
push:
5-
tags:
6-
- 'v*.*.*'
4+
release:
5+
types: [prereleased, released]
6+
77
jobs:
8-
tarball:
9-
if: github.event_name == 'push'
10-
timeout-minutes: 1
11-
runs-on: ubuntu-20.04
12-
env:
13-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
14-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write # softprops/action-gh-release
12+
id-token: write # pypa/gh-action-pypi-publish
13+
issues: write # apexskier/github-release-commenter
14+
pull-requests: write # apexskier/github-release-commenter
15+
1516
steps:
16-
- uses: actions/checkout@v1
17-
18-
- uses: actions/setup-python@v1
19-
with:
20-
python-version: "3.8.x"
21-
22-
# https://github.community/t/how-to-get-just-the-tag-name/16241/4
23-
- name: Extract the version number
24-
id: get_version
25-
run: |
26-
echo ::set-output name=V::$(python smart_open/version.py)
27-
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
python -m venv venv
32-
. venv/bin/activate
33-
pip install twine wheel
34-
35-
- name: Build and upload tarball to PyPI
36-
run: |
37-
. venv/bin/activate
38-
python setup.py sdist
39-
twine upload dist/smart_open-${{ steps.get_version.outputs.V }}.tar.gz -u ${{ env.PYPI_USERNAME }} -p ${{ env.PYPI_PASSWORD }}
40-
41-
- name: Build and upload wheel to PyPI
42-
run: |
43-
. venv/bin/activate
44-
python setup.py bdist_wheel
45-
twine upload dist/smart_open-${{ steps.get_version.outputs.V }}-py3-none-any.whl -u ${{ env.PYPI_USERNAME }} -p ${{ env.PYPI_PASSWORD }}
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__)
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.x
25+
26+
- name: Install dependencies
27+
run: |
28+
pip install --upgrade pip setuptools wheel build
29+
30+
- name: Build package distributions
31+
run: |
32+
python -m build
33+
34+
- name: Upload package distributions as release assets
35+
uses: softprops/[email protected]
36+
with:
37+
files: dist/*
38+
39+
# https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
40+
- name: Publish package distributions to PyPI
41+
uses: pypa/[email protected]
42+
43+
- uses: apexskier/[email protected]
44+
with:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
comment-template: |
47+
Released {release_link}

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 7.3.0, 2025-07-01
2+
3+
- Remove head_bucket call from s3.SinglepartWriter (PR [#857](https://github.com/piskvorky/smart_open/pull/857), [@ddelange](https://github.com/ddelange))
4+
- Add help.txt linting step (PR [#853](https://github.com/piskvorky/smart_open/pull/853), [@ddelange](https://github.com/ddelange))
5+
- Add buffer_size transport param to ssh.py (PR [#861](https://github.com/piskvorky/smart_open/pull/861), [@ddelange](https://github.com/ddelange))
6+
- Fix integration test CI rot (PR [#864](https://github.com/piskvorky/smart_open/pull/864), [@ddelange](https://github.com/ddelange))
7+
- Fix try-except in ssh.py for missing port in ssh config (PR [#863](https://github.com/piskvorky/smart_open/pull/863), [@ddelange](https://github.com/ddelange))
8+
- Make s3.SinglepartWriter seekable (PR [#854](https://github.com/piskvorky/smart_open/pull/854), [@ddelange](https://github.com/ddelange))
9+
- Modernize python packaging (PR [#851](https://github.com/piskvorky/smart_open/pull/851), [@ddelange](https://github.com/ddelange))
10+
111
# 7.2.0, 2025-03-06
212

313
- Add support for prefetching to sftp transport (PR [#849](https://github.com/piskvorky/smart_open/pull/849), [@davidszotten](https://github.com/davidszotten))
@@ -500,5 +510,4 @@ The old `smart_open.smart_open` function is deprecated, but continues to work as
500510
# 1.1.0, 1st February 2015
501511

502512
- support for multistream bzip files (PR #9, @pombredanne)
503-
- introduce this CHANGELOG
504-
513+
- introduce this CHANGELOG

MANIFEST.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include LICENSE
2-
include README.rst
3-
include MIGRATING_FROM_OLDER_VERSIONS.rst
4-
include CHANGELOG.md
1+
global-exclude *
2+
include pyproject.toml
3+
graft smart_open
4+
global-exclude *.pyc

0 commit comments

Comments
 (0)