Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Release fixes
There were a few things that were broken due to the change to
pyproject.toml.

- Use license instead of deprecated license classifier
- Clean up classifiers (only use those in
  https://pypi.org/pypi?%3Aaction=list_classifiers)
- Install pytorch via pip, conda seems deprecated
- Use build instead of setup py for wheel/sdist
  • Loading branch information
nemo committed Aug 8, 2025
commit cd1d69047350ec3edb7146c8fd6df60dbe7fb424
13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = ["setuptools>=61.1.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.package-data]
[tool.setuptools.package-data]
"*" = ["VERSION", "LICENSE", "*.rst"]

[tool.setuptools.packages.find]
Expand All @@ -13,6 +13,7 @@ exclude = ["notebooks", "assets"]
name = "skorch"
dynamic = ["version", "readme"]
description = "scikit-learn compatible neural network library for pytorch"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
requires-python = ">=3.9"
dependencies =[
Expand All @@ -30,15 +31,13 @@ authors = [
{name = "skorch Developers"}
]
classifiers = [ #note:classifiers are recommended for packages to be visible on PyPI
"License ::BSD 3-Clause License",
"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",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Machine Learning",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
Expand Down Expand Up @@ -84,7 +83,7 @@ extended = [
]


[tool.coverage.run]
[tool.coverage.run]
source = ["."]
include = ["skorch/*"]
omit = [
Expand Down Expand Up @@ -112,10 +111,10 @@ testpaths = ["skorch/tests"]
[tool.pylint.main]
load-plugins = "pylint.extensions.no_self_use"

[tool.pylint.messages_control]
[tool.pylint.messages_control]
disable = [
"raw-checker-failed",
"bad-inline-option",
"bad-inline-option",
"locally-disabled",
"file-ignored",
"suppressed-message",
Expand Down Expand Up @@ -184,4 +183,4 @@ max-public-methods = 40

[tool.setuptools.dynamic]
version = {file = "VERSION"}
readme = {file = "README.rst", content-type = "text/x-rst"}
readme = {file = "README.rst", content-type = "text/x-rst"}
15 changes: 7 additions & 8 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o pipefail

PYTORCH_VERSION=${PYTORCH_VERSION:-""}
PYTHON_VERSION="3.9"
TWINE_VERSION="\>3,\<4.0.0dev" # escaped <,> are necessary for conda run
TWINE_VERSION=">3,<4.0.0dev"
CONDA_ENV="skorch-deploy"

if [[ $# -gt 1 ]] || [[ $1 != "live" && $1 != "stage" ]]; then
Expand Down Expand Up @@ -49,14 +49,13 @@ run_in_env() {
trap remove_env EXIT

echo "installing dependencies"
conda install -c pytorch -y "pytorch==${PYTORCH_VERSION}"
run_in_env python -m pip install "torch==${PYTORCH_VERSION}" --index-url https://download.pytorch.org/whl/cpu
run_in_env python -m pip install "twine${TWINE_VERSION}"
# Workaround for error `AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'`
# due to outdated system pyOpenSSL - see also: https://askubuntu.com/q/1428181
run_in_env python -m pip install pyOpenSSL --upgrade
run_in_env python -m pip install -r requirements.txt
run_in_env python -m pip install -r requirements-dev.txt
run_in_env python -m pip install .
run_in_env python -m pip install '.[dev,test,docs,extended]'
run_in_env python -m pip install build
run_in_env python -m pip list

run_in_env pytest -x
Expand All @@ -65,10 +64,10 @@ run_in_env pytest -x
run_in_env python -m pip install readme-renderer
run_in_env python -m readme_renderer README.rst > /dev/null

run_in_env python setup.py sdist bdist_wheel
run_in_env python -m build --sdist --wheel

if [[ $1 == "live" ]]; then
run_in_env twine upload dist/*"$(cat VERSION)"*
run_in_env twine upload --verbose dist/*"$(cat VERSION)"*
else
run_in_env twine upload --repository-url https://test.pypi.org/legacy/ dist/*"$(cat VERSION)"*
run_in_env twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*"$(cat VERSION)"*
fi