-
-
Notifications
You must be signed in to change notification settings - Fork 385
Modernize python packaging #851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
66835f2
Modernize python packaging
ddelange 624b684
Clean up release folder according to simplified release workflow
ddelange 6159632
Typo
ddelange 2792f4f
Clean up
ddelange 4633b9d
Typo
ddelange a8ba147
Add links
ddelange caa61a4
Update docs to have CHANGELOG commits on develop
ddelange 6be5afa
Delete annotate_pr.py
ddelange e760eba
Add update_changelog.py
ddelange 9cd101c
Merge branch 'develop' of https://github.com/RaRe-Technologies/smart_…
ddelange d2abfba
Merge branch 'develop' into pypa-publish
ddelange b594a5f
Run python update_helptext.py
ddelange 72daf9e
Add branch filters to push event
ddelange fdd7e2e
Bring back release.sh
ddelange 31965b2
Do a local merge for cleaner commit message
ddelange a1aec06
Merge branch 'piskvorky:develop' into pypa-publish
ddelange c472091
Merge remote-tracking branch 'upstream/develop' into ddelange_pypa-pu…
mpenkov 0fdc2d7
Merge branch 'develop' of https://github.com/piskvorky/smart_open int…
ddelange File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
groups: | ||
github-actions: | ||
patterns: | ||
- '*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,47 @@ | ||
name: Release to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
release: | ||
types: [prereleased, released] | ||
|
||
jobs: | ||
tarball: | ||
if: github.event_name == 'push' | ||
timeout-minutes: 1 | ||
runs-on: ubuntu-20.04 | ||
env: | ||
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # softprops/action-gh-release | ||
id-token: write # pypa/gh-action-pypi-publish | ||
issues: write # apexskier/github-release-commenter | ||
pull-requests: write # apexskier/github-release-commenter | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8.x" | ||
|
||
# https://github.community/t/how-to-get-just-the-tag-name/16241/4 | ||
- name: Extract the version number | ||
id: get_version | ||
run: | | ||
echo ::set-output name=V::$(python smart_open/version.py) | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m venv venv | ||
. venv/bin/activate | ||
pip install twine wheel | ||
|
||
- name: Build and upload tarball to PyPI | ||
run: | | ||
. venv/bin/activate | ||
python setup.py sdist | ||
twine upload dist/smart_open-${{ steps.get_version.outputs.V }}.tar.gz -u ${{ env.PYPI_USERNAME }} -p ${{ env.PYPI_PASSWORD }} | ||
|
||
- name: Build and upload wheel to PyPI | ||
run: | | ||
. venv/bin/activate | ||
python setup.py bdist_wheel | ||
twine upload dist/smart_open-${{ steps.get_version.outputs.V }}-py3-none-any.whl -u ${{ env.PYPI_USERNAME }} -p ${{ env.PYPI_PASSWORD }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # fetch git tags for setuptools_scm (smart_open.__version__) | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip setuptools wheel build | ||
|
||
- name: Build package distributions | ||
run: | | ||
python -m build | ||
|
||
- name: Upload package distributions as release assets | ||
uses: softprops/[email protected] | ||
with: | ||
files: dist/* | ||
|
||
# https://github.com/pypa/gh-action-pypi-publish#trusted-publishing | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/[email protected] | ||
|
||
- uses: apexskier/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
comment-template: | | ||
Released {release_link} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include LICENSE | ||
include README.rst | ||
include MIGRATING_FROM_OLDER_VERSIONS.rst | ||
include CHANGELOG.md | ||
global-exclude * | ||
include pyproject.toml | ||
graft smart_open | ||
global-exclude *.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,10 +32,8 @@ PACKAGE CONTENTS | |
s3 | ||
smart_open_lib | ||
ssh | ||
tests (package) | ||
transport | ||
utils | ||
version | ||
webhdfs | ||
|
||
FUNCTIONS | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,58 @@ | ||
[tool.pytest.ini_options] | ||
testpaths = ["smart_open"] | ||
[build-system] | ||
requires = ["setuptools>=64", "setuptools_scm>=8"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
fallback_version = "0.1.dev1+gitnotfound" | ||
|
||
[project] | ||
name = "smart_open" | ||
description = "Utils for streaming large files (S3, HDFS, GCS, SFTP, Azure Blob Storage, gzip, bz2, zst...)" | ||
readme = "README.rst" | ||
urls = {Repository = "https://github.com/piskvorky/smart_open"} | ||
authors = [{name = "Radim Rehurek", email = "[email protected]"}] | ||
requires-python = ">=3.7,<4.0" # sync with classifiers below | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: System :: Distributed Computing", | ||
"Topic :: Database :: Front-Ends", | ||
] | ||
dynamic = ["version"] | ||
dependencies = ["wrapt"] | ||
|
||
[project.optional-dependencies] | ||
s3 = ["boto3"] | ||
gcs = ["google-cloud-storage>=2.6.0"] | ||
azure = ["azure-storage-blob", "azure-common", "azure-core"] | ||
http = ["requests"] | ||
webhdfs = ["requests"] | ||
ssh = ["paramiko"] | ||
zst = ["zstandard"] | ||
all = ["smart_open[s3,gcs,azure,http,webhdfs,ssh,zst]"] | ||
test = [ | ||
"smart_open[all]", | ||
"moto[server]", | ||
"responses", | ||
"pytest", | ||
"pytest-rerunfailures", | ||
"pytest_benchmark", | ||
"awscli", | ||
"pyopenssl", | ||
"numpy", | ||
] | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["smart_open"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first time #853 comes in handy: just pulled
develop
and lint started failing on this PR :)