Skip to content

Commit

Permalink
Support Python 3.9, drop Python 3.6 (#4332)
Browse files Browse the repository at this point in the history
* ⬆️ support py39, drop py36
* 📝 add release note
  • Loading branch information
MarcoGorelli authored Dec 14, 2020
1 parent f4552e3 commit dbcc49e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 25 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment-dev-py36.yml has not changed
# Increase this value to reset cache if environment-dev-py39.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py36.yml') }}
hashFiles('conda-envs/environment-dev-py39.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
Expand All @@ -90,18 +90,18 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py36
activate-environment: pymc3-dev-py39
channel-priority: strict
environment-file: conda-envs/environment-dev-py36.yml
environment-file: conda-envs/environment-dev-py39.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
run: |
conda activate pymc3-dev-py36
conda activate pymc3-dev-py39
pip install -e .
python --version
- name: Run tests
run: |
conda activate pymc3-dev-py36
conda activate pymc3-dev-py39
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ repos:
additional_dependencies: [isort==5.6.4]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==2.7.4]
args: [--py37-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.6.4
hooks:
Expand All @@ -31,7 +32,7 @@ repos:
rev: v2.7.4
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ The preferred workflow for contributing to PyMC3 is to fork the [GitHub reposito
4. Project requirements are in ``requirements.txt``, and libraries used for development are in ``requirements-dev.txt``. The easiest (and recommended) way to set up a development environment is via [miniconda](https://docs.conda.io/en/latest/miniconda.html):
```bash
$ conda env create -f conda-envs/environment-dev-py36.yml # or py37 or py38
$ conda activate pymc3-dev-py36
$ conda env create -f conda-envs/environment-dev-py37.yml # or py38 or py39
$ conda activate pymc3-dev-py37
$ pip install -e .
```
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Dependencies
============

PyMC3 is tested on Python 3.6, 3.7, and 3.8 and depends on `Theano-PyMC <https://github.com/pymc-devs/Theano-PyMC>`__,
NumPy, SciPy, and Pandas
NumPy, SciPy, and pandas
(see `requirements.txt <https://github.com/pymc-devs/pymc3/blob/master/requirements.txt>`__ for version
information).

Expand Down
4 changes: 3 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release Notes

## PyMC3 3.10.1 (on deck)
## PyMC3 4.0.0 (on deck)

This is the first release to support Python3.9 and to drop Python3.6.

### Maintenance
- Fixed bug whereby partial traces returns after keyboard interrupt during parallel sampling had fewer draws than would've been available [#4318](https://github.com/pymc-devs/pymc3/pull/4318)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: pymc3-dev-py36
name: pymc3-dev-py39
channels:
- conda-forge
- defaults
dependencies:
- contextvars
- dataclasses
- h5py>=2.7
- ipython>=7.16
- libblas=*=*mkl
Expand All @@ -15,7 +13,7 @@ dependencies:
- pytest-cov>=2.5
- pytest>=3.0
- python-graphviz
- python=3.6
- python=3.9
- recommonmark>=0.4
- sphinx-autobuild>=0.7
- sphinx>=1.5
Expand Down
2 changes: 1 addition & 1 deletion pymc3/backends/tracetab.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def trace_to_dataframe(trace, chains=None, varnames=None, include_transformed=False):
"""Convert trace to Pandas DataFrame.
"""Convert trace to pandas DataFrame.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pymc3/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class Data:
A value to associate with this variable
dims: {str, tuple of str}, optional, default=None
Dimension names of the random variables (as opposed to the shapes of these
random variables). Use this when `value` is a Pandas Series or DataFrame. The
random variables). Use this when `value` is a pandas Series or DataFrame. The
`dims` will then be the name of the Series / DataFrame's columns. See ArviZ
documentation for more information about dimensions and coordinates:
https://arviz-devs.github.io/arviz/notebooks/Introduction.html
Expand Down
2 changes: 1 addition & 1 deletion pymc3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ def init_value(self):


def pandas_to_array(data):
"""Convert a Pandas object to a NumPy array.
"""Convert a pandas object to a NumPy array.
XXX: When `data` is a generator, this will return a Theano tensor!
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ exclude_lines = [
isort = 1
black = 1
pyupgrade = 1

[tool.nbqa.addopts]
pyupgrade = ["--py36-plus"]
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
arviz>=0.9.0
contextvars; python_version < '3.7'
dataclasses; python_version < '3.7'
dill
fastprogress>=0.2.0
numpy>=1.13.0
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
Expand Down Expand Up @@ -82,7 +82,7 @@ def get_version():
# package_data={'docs': ['*']},
include_package_data=True,
classifiers=classifiers,
python_requires=">=3.6",
python_requires=">=3.7",
install_requires=install_reqs,
tests_require=test_reqs,
test_suite="nose.collector",
Expand Down

0 comments on commit dbcc49e

Please sign in to comment.