Skip to content

Commit

Permalink
PyTorch 181 and some minor updates (skorch-dev#755)
Browse files Browse the repository at this point in the history
* Add PyTorch 1.8.1 to CI, docs

Also:

- remove PyTorch 1.4.
- bump to cuda_toolkit 11.1.
- add Python 3.9
- remove mention of Python 3.5
- Add more common file types to .gitignore
- No longer mention nolearn in doc intro
- Update environment.yml using  --from-history
- Add dirty worktree check to deploy.sh
- Add README rendering check to deploy.sh
- Add flake8 section to setup.cfg
- Add python_requires >= 3.6 to setup.py
  • Loading branch information
BenjaminBossan authored Apr 23, 2021
1 parent 6c6ea3f commit 6e5df5b
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 49 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python_version: ['3.6', '3.7', '3.8']
torch_version: ['1.4.0+cpu', '1.5.1+cpu', '1.6.0+cpu', '1.7.1+cpu']
python_version: ['3.6', '3.7', '3.8', '3.9']
torch_version: ['1.5.1+cpu', '1.6.0+cpu', '1.7.1+cpu', '1.8.1+cpu']
os: [ubuntu-latest]
exclude:
- python_version: '3.9'
torch_version: '1.5.1+cpu'
- python_version: '3.9'
torch_version: '1.6.0+cpu'
- python_version: '3.9'
torch_version: '1.7.1+cpu'

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ data/
*.w2v
*prof
*.py~
*.pt
*.pt
*.pth
*.pickle
*.mat
*.ipynb
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ skorch also provides many convenient features, among others:
Installation
============

skorch requires Python 3.5 or higher.
skorch requires Python 3.6 or higher.

conda installation
==================
Expand Down Expand Up @@ -234,22 +234,22 @@ instructions for PyTorch, visit the `PyTorch website
<http://pytorch.org/>`__. skorch officially supports the last four
minor PyTorch versions, which currently are:

- 1.4.0
- 1.5.1
- 1.6.0
- 1.7.1
- 1.8.1

However, that doesn't mean that older versions don't work, just that
they aren't tested. Since skorch mostly relies on the stable part of
the PyTorch API, older PyTorch versions should work fine.

In general, running this to install PyTorch should work (assuming CUDA
10.2):
11.1):

.. code:: bash
# using conda:
conda install pytorch cudatoolkit==10.2 -c pytorch
conda install pytorch cudatoolkit==11.1 -c pytorch
# using pip
pip install torch
Expand Down
5 changes: 1 addition & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ Introduction

The goal of skorch is to make it possible to use PyTorch_ with
sklearn_. This is achieved by providing a wrapper around
PyTorch that has an sklearn interface. In that sense,
skorch is the spiritual successor to nolearn_, but instead of
using Lasagne and Theano, it uses PyTorch.
PyTorch that has an sklearn interface.

skorch does not re-invent the wheel, instead getting as much out
of your way as possible. If you are familiar with sklearn and
Expand Down Expand Up @@ -84,6 +82,5 @@ Indices and tables
* :ref:`search`


.. _nolearn: https://github.com/dnouri/nolearn
.. _pytorch: http://pytorch.org/
.. _sklearn: http://scikit-learn.org/
6 changes: 3 additions & 3 deletions docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,21 @@ instructions for PyTorch, visit the `PyTorch website
<http://pytorch.org/>`__. skorch officially supports the last four
minor PyTorch versions, which currently are:

- 1.4.0
- 1.5.1
- 1.6.0
- 1.7.1
- 1.8.1

However, that doesn't mean that older versions don't work, just that
they aren't tested. Since skorch mostly relies on the stable part of
the PyTorch API, older PyTorch versions should work fine.

In general, running this to install PyTorch should work (assuming CUDA
10.2):
11.1):

.. code:: bash
# using conda:
conda install pytorch cudatoolkit==10.2 -c pytorch
conda install pytorch cudatoolkit==11.1 -c pytorch
# using pip
pip install torch
154 changes: 124 additions & 30 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,130 @@ channels:
- pytorch
- conda-forge
dependencies:
- zlib=1.2.11
- sphinxcontrib-serializinghtml=1.1.4
- mkl-service=2.3.0
- click=7.1.2
- importlib-metadata=3.10.0
- tensorboard[version='>=1.14.0']
- google-auth-oauthlib=0.4.2
- libgcc-ng=9.1.0
- sqlite=3.35.4
- ca-certificates
- lazy-object-proxy=1.6.0
- pytorch=1.8.1
- packaging=20.9
- babel=2.9.0
- python=3.9.4
- pyjwt=2.0.1
- chardet=3.0.4
- numpydoc
- certifi
- blinker=1.4
- tensorboard-plugin-wit=1.6.0
- astroid=2.5
- attrs=20.3.0
- threadpoolctl=2.1.0
- google-auth=1.28.1
- tzdata=2020f
- libstdcxx-ng=9.1.0
- scipy=1.6.2
- wrapt=1.12.1
- absl-py=0.12.0
- more-itertools=8.7.0
- intel-openmp=2020.2
- libgfortran-ng=7.3.0
- werkzeug=1.0.1
- numpy-base=1.19.2
- imagesize=1.2.0
- wheel=0.36.2
- scikit-learn=0.24.1
- pluggy=0.13.1
- typing-extensions=3.7.4.3
- aiohttp=3.7.4
- pyasn1-modules=0.2.8
- sphinxcontrib-htmlhelp=1.0.3
- yarl=1.6.3
- _libgcc_mutex=0.1
- rsa=4.7.2
- protobuf=3.14.0
- c-ares=1.17.1
- tqdm=4.59.0
- docutils=0.17
- tabulate=0.8.9
- cryptography=2.9.2
- idna=2.10
- oauthlib=3.1.0
- alabaster=0.7.12
- zipp=3.4.1
- ninja=1.10.2
- sphinxcontrib-qthelp=1.0.3
- pytest-cov
- blas=1.0
- fire=0.3.1
- flaky=3.6.1
- future=0.18.2
- joblib=0.14.1
- jupyter=1.0.0
- matplotlib=3.1.3
- neptune-client=0.4.110
- numpy=1.18.1
- numpy-base=1.18.1
- numpydoc=0.9.2
- openpyxl=3.0.3
- pandas=1.0.3
- pillow=5.3.0
- pip=20.0.2
- pylint=2.4.4
- pytest=5.4.1
- pytest-cov=2.8.1
- python=3.7.7
- pytorch=1.4.0
- scikit-learn=0.22.1
- scipy=1.4.1
- setuptools=46.1.3
- six=1.14.0
- sphinx=3.0.1
- sphinx_rtd_theme=0.4.3
- tabulate=0.8.3
- tensorboard=1.15.0
- tqdm=4.44.1
- wheel=0.34.2
- isort=5.8.0
- jinja2=2.11.3
- markupsafe=1.1.1
- cachetools=4.2.1
- python-dateutil=2.8.1
- colorama=0.4.4
- libuv=1.40.0
- sphinxcontrib-applehelp=1.0.2
- pyasn1=0.4.8
- toml=0.10.2
- pyopenssl=20.0.1
- requests-oauthlib=1.3.0
- async-timeout=3.0.1
- flaky
- pycparser=2.20
- multidict=5.1.0
- libffi=3.3
- snowballstemmer=2.1.0
- pytz=2021.1
- cffi=1.14.5
- mccabe=0.6.1
- grpcio=1.36.1
- openssl
- six=1.15.0
- setuptools=52.0.0
- numpy=1.19.2
- ld_impl_linux-64=2.33.1
- requests=2.25.1
- iniconfig=1.1.1
- pysocks=1.7.1
- pylint
- urllib3=1.26.4
- coverage=5.5
- cudatoolkit=10.2.89
- pip=21.0.1
- pyparsing=2.4.7
- markdown=3.3.4
- pytest[version='>=3.4']
- sphinxcontrib-jsmath=1.0.1
- readline=8.1
- tk=8.6.10
- pygments=2.8.1
- cython=0.29.23
- ncurses=6.2
- mkl_random=1.0.2
- brotlipy=0.7.0
- pandas
- libprotobuf=3.14.0
- mkl_fft=1.3.0
- xz=5.2.5
- mkl=2020.2
- py=1.10.0
- typing_extensions=3.7.4.3
- joblib=1.0.1
- sphinx
- sphinxcontrib-devhelp=1.0.2
- neptune-client[version='>=0.4.103']
- pillow
- fire
- openpyxl
- sphinx_rtd_theme
- wandb[version='>=0.8.30']
- future[version='>=0.17.1']
- matplotlib[version='>=2.0.2']
- jupyter
- pip:
- wandb>=0.8.30
- sacred==0.8.2
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ future>=0.17.1
jupyter
matplotlib>=2.0.2
neptune-client>=0.4.103
sacred
numpydoc
openpyxl
pandas
pillow
pylint
pytest>=3.4
pytest-cov
sacred
sphinx
sphinx_rtd_theme
tensorboard>=1.14.0
Expand Down
7 changes: 7 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ if [ -z "$PYTORCH_VERSION" ]; then
exit 1
fi

# check if worktree is not dirty, see https://stackoverflow.com/a/5737794
test -z "$(git status --porcelain --untracked-files=no)"

conda update -q -y conda

# Remove previous deploy environment
Expand Down Expand Up @@ -46,6 +49,10 @@ python setup.py install

pytest -x

# check if README can be rendered correctly on PyPI
pip install readme-renderer
python -m readme_renderer README.rst > /dev/null

python setup.py sdist bdist_wheel

if [[ $1 == "live" ]]; then
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ python_files = test*py

[metadata]
description-file = README.rst

[flake8]
max-line-length = 88
docstring-convention = numpy
ignore = D204,D401
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
with open('requirements.txt') as f:
install_requires = [l.strip() for l in f]


python_requires = '>=3.6'

tests_require = [
'pytest',
'pytest-cov',
Expand All @@ -26,10 +29,6 @@
except IOError:
README = ''

try:
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
except IOError:
CHANGES = ''

setup(
name='skorch',
Expand All @@ -41,6 +40,7 @@
include_package_data=True,
url="https://github.com/skorch-dev/skorch",
zip_safe=False,
python_requires=python_requires,
install_requires=install_requires,
extras_require={
'testing': tests_require,
Expand Down

0 comments on commit 6e5df5b

Please sign in to comment.