Skip to content
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

Sync up to main repo #4

Merged
merged 51 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
659aa48
Improve documentation of safety constraints on hashable objects (#505)
Feb 14, 2019
1fada3d
Be consistent in calling slotted classes slotted
hynek Feb 25, 2019
4de9481
Exclude test_annotations from pypy3
hynek Feb 25, 2019
aa9f62f
Use 3.7 for RTD
hynek Feb 25, 2019
a35d8fb
fix and simplify docs CI
hynek Feb 25, 2019
25a98cb
Implement first class exception support (#500)
hynek Feb 25, 2019
4b88f92
Remove _add_init
hynek Feb 27, 2019
d74434f
Ignore pip-wheel-metadata
hynek Feb 27, 2019
0f453c6
Add a pointless line to newsfragment to trick towncrier
hynek Mar 3, 2019
8b83ef7
Brandon got TLS now!
hynek Mar 3, 2019
0356f06
Prepare 19.1.0
hynek Mar 3, 2019
f3f386b
Start 19.2 cycle
hynek Mar 3, 2019
34efa98
add long_description_content_type
hynek Mar 4, 2019
c2a9dd8
Remove code and tests related to deprecated 'convert' kwarg (#504)
ramatevish Mar 7, 2019
dacfa06
precommit autoupdate
hynek Mar 7, 2019
4fe2896
Fix pytest dependency pytest
hynek Mar 7, 2019
957b198
Fix validators __all__ (#517)
mattsb42-aws Mar 13, 2019
9c1025b
Be consistent with slotted classes
hynek Mar 21, 2019
d0806d9
Consistency for slotted classes
hynek Mar 21, 2019
6fa28b3
Fix rtype for has
hynek Apr 13, 2019
de84609
This is not accurate
hynek May 2, 2019
0acfba6
Pure-Python approach to closure cell rewriting (#522)
oremanj May 8, 2019
729681b
[WIP] Set up CI with Azure Pipelines (#510)
hynek May 8, 2019
3383647
Add pypy to Azure Pipelines (#529)
hynek May 8, 2019
de8caa8
Remove some extraneous # noqa comments (#530)
asottile May 14, 2019
205e6ed
Ken isn't at DO anymore
hynek May 21, 2019
669e69d
fix typo in docs (#534)
obestwalter May 26, 2019
45adbb9
Fix deep_iterable, deep_mapping validator type stubs (#533)
mmaslowskicc May 27, 2019
0f3d20e
Update azure-pipelines.yml
hynek May 31, 2019
d6ca77a
Nicer env handling
hynek May 31, 2019
3f5a879
fix double name
hynek May 31, 2019
4e9f971
fix yaml syntax
hynek May 31, 2019
2a39135
Make separation of AP variables & env variables more obvious
hynek May 31, 2019
79a9db4
Give it some air
hynek May 31, 2019
ec7ed49
Update azure-pipelines.yml
hynek May 31, 2019
b5c0e5c
Remove more travis
hynek May 31, 2019
39b11bd
pre-commit autoupdate
hynek May 31, 2019
1aa617d
Use separate Python for tools in AP
hynek May 31, 2019
3c9522e
Consistency
hynek May 31, 2019
4f659d5
Cleanup whitespace
hynek May 31, 2019
dc110b0
Try 3.8
hynek May 31, 2019
655c6c0
Disable 3.8 for now
hynek May 31, 2019
40d5c90
Use the same version of coverage for combine
hynek Jun 2, 2019
a686f74
Fix closure cell rewriting on 3.8 (#539)
oremanj Jun 4, 2019
776d09d
Run py38 under coverage too
hynek Jun 4, 2019
1dcf46f
3.8 can't find coverage
hynek Jun 4, 2019
4d03c7d
Be explicit about 3.8
hynek Jun 4, 2019
3fb6f72
[wip] 3.5 and 3.7 are broken on AP and Microsoft doesn't care (#541)
hynek Jun 6, 2019
867504c
Special case deadsnakes coverage (#542)
hynek Jun 6, 2019
a390f6a
Skip coverage step if there's no data
hynek Jun 6, 2019
25a02bb
Simplify coverage mapping
hynek Jun 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ source =

[paths]
source =
src/attr
.tox/*/lib/python*/site-packages/attr
.tox/pypy/site-packages/attr
src
.tox/*/site-packages

[report]
show_missing = True
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Tests
assert "foo" == x._a_private_attribute

- To run the test suite, all you need is a recent tox_.
It will ensure the test suite runs with all dependencies against all Python versions just as it will on Travis CI.
It will ensure the test suite runs with all dependencies against all Python versions just as it will in our CI.
If you lack some Python versions, you can can always limit the environments like ``tox -e py27,py35`` (in that case you may want to look into pyenv_, which makes it very easy to install many different Python versions in parallel).
- Write `good test docstrings`_.
- To ensure new features work well with the rest of the system, they should be also added to our `Hypothesis`_ testing strategy, which is found in ``tests/strategies.py``.
Expand Down Expand Up @@ -238,10 +238,10 @@ Thank you for considering contributing to ``attrs``!
.. _tox: https://tox.readthedocs.io/
.. _pyenv: https://github.com/pyenv/pyenv
.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
.. _semantic newlines: http://rhodesmill.org/brandon/2012/one-sentence-per-line/
.. _semantic newlines: https://rhodesmill.org/brandon/2012/one-sentence-per-line/
.. _examples page: https://github.com/python-attrs/attrs/blob/master/docs/examples.rst
.. _Hypothesis: https://hypothesis.readthedocs.io/
.. _CI: https://travis-ci.org/python-attrs/attrs/
.. _CI: https://attrs.visualstudio.com/attrs/_build/latest?definitionId=1&branchName=master
.. _`team of volunteers`: https://github.com/python-attrs
.. _BDFL: https://en.wikipedia.org/wiki/Benevolent_dictator_for_life
.. _towncrier: https://pypi.org/project/towncrier
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If an item doesn't apply to your pull request, **check it anyway** to make it ap
- [ ] New functions/classes have to be added to `docs/api.rst` by hand.
- [ ] Changes to the signature of `@attr.s()` have to be added by hand too.
- [ ] Changed/added classes/methods/functions have appropriate `versionadded`, `versionchanged`, or `deprecated` [directives](http://www.sphinx-doc.org/en/stable/markup/para.html#directive-versionadded).
- [ ] Documentation in `.rst` files is written using [semantic newlines](http://rhodesmill.org/brandon/2012/one-sentence-per-line/).
- [ ] Documentation in `.rst` files is written using [semantic newlines](https://rhodesmill.org/brandon/2012/one-sentence-per-line/).
- [ ] Changes (and possible deprecations) have news fragments in [`changelog.d`](https://github.com/python-attrs/attrs/blob/master/changelog.d).

If you have *any* questions to *any* of the points above, just **submit and ask**! This checklist is here to *help* you, not to deter you from contributing!
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.pyc
*.egg-info
*.pyc
.cache
.coverage*
.hypothesis
Expand All @@ -10,3 +10,4 @@ build
dist
docs/_build/
htmlcov
pip-wheel-metadata
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: 18.9b0
rev: 19.3b0
hooks:
- id: black
language_version: python3.7
Expand All @@ -9,24 +9,24 @@ repos:
types: []

- repo: https://gitlab.com/pycqa/flake8
rev: '3.7.3'
rev: 3.7.7
hooks:
- id: flake8
language_version: python3.7

- repo: https://github.com/asottile/seed-isort-config
rev: v1.5.0
rev: v1.9.1
hooks:
- id: seed-isort-config

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
rev: v4.3.20
hooks:
- id: isort
language_version: python3.7

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
12 changes: 8 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
version: 2
python:
version: 3
pip_install: true
extra_requirements:
- docs
version: 3.7

install:
- method: pip
path: .
extra_requirements:
- docs
80 changes: 0 additions & 80 deletions .travis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,49 @@ Changes for the upcoming release can be found in the `"changelog.d" directory <h

.. towncrier release notes start

19.1.0 (2019-03-03)
-------------------

Backward-incompatible Changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Fixed a bug where deserialized objects with ``cache_hash=True`` could have incorrect hash code values.
This change breaks classes with ``cache_hash=True`` when a custom ``__setstate__`` is present.
An exception will be thrown when applying the ``attrs`` annotation to such a class.
This limitation is tracked in issue `#494 <https://github.com/python-attrs/attrs/issues/494>`_.
`#482 <https://github.com/python-attrs/attrs/issues/482>`_


Changes
^^^^^^^

- Add ``is_callable``, ``deep_iterable``, and ``deep_mapping`` validators.

* ``is_callable``: validates that a value is callable
* ``deep_iterable``: Allows recursion down into an iterable,
applying another validator to every member in the iterable
as well as applying an optional validator to the iterable itself.
* ``deep_mapping``: Allows recursion down into the items in a mapping object,
applying a key validator and a value validator to the key and value in every item.
Also applies an optional validator to the mapping object itself.

You can find them in the ``attr.validators`` package.
`#425 <https://github.com/python-attrs/attrs/issues/425>`_
- Fixed stub files to prevent errors raised by mypy's ``disallow_any_generics = True`` option.
`#443 <https://github.com/python-attrs/attrs/issues/443>`_
- Attributes with ``init=False`` now can follow after ``kw_only=True`` attributes.
`#450 <https://github.com/python-attrs/attrs/issues/450>`_
- ``attrs`` now has first class support for defining exception classes.

If you define a class using ``@attr.s(auto_exc=True)`` and subclass an exception, the class will behave like a well-behaved exception class including an appropriate ``__str__`` method, and all attributes additionally available in an ``args`` attribute.
`#500 <https://github.com/python-attrs/attrs/issues/500>`_
- Clarified documentation for hashing to warn that hashable objects should be deeply immutable (in their usage, even if this is not enforced).
`#503 <https://github.com/python-attrs/attrs/issues/503>`_


----


18.2.0 (2018-09-01)
-------------------

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
:target: https://www.attrs.org/en/stable/?badge=stable
:alt: Documentation Status

.. image:: https://travis-ci.org/python-attrs/attrs.svg?branch=master
:target: https://travis-ci.org/python-attrs/attrs
.. image:: https://attrs.visualstudio.com/attrs/_apis/build/status/python-attrs.attrs?branchName=master
:target: https://attrs.visualstudio.com/attrs/_build/latest?definitionId=1&branchName=master
:alt: CI Status

.. image:: https://codecov.io/github/python-attrs/attrs/branch/master/graph/badge.svg
Expand Down Expand Up @@ -101,7 +101,7 @@ Testimonials
It exerts a subtle, but positive, design influence in all the codebases I’ve see it used in.


**Kenneth Reitz**, author of `Requests <http://www.python-requests.org/>`_ and Developer Advocate at DigitalOcean, (`on paper no less <https://twitter.com/hynek/status/866817877650751488>`_!):
**Kenneth Reitz**, author of `Requests <http://www.python-requests.org/>`_ (`on paper no less <https://twitter.com/hynek/status/866817877650751488>`_!):

attrs—classes for humans. I like it.

Expand Down
114 changes: 114 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
trigger:
- master

jobs:
- job: 'Test'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Typing:
python.version: '3.7'
tox.env: typing
Lint:
python.version: '3.7'
tox.env: lint

py27:
python.version: '2.7'
tox.env: py27
py34:
python.version: '3.4'
tox.env: py34
py35:
python.version: '3.5'
tox.env: py35
py36:
python.version: '3.6'
tox.env: py36
py37:
python.version: '3.7'
tox.env: py37
py38:
python.version: '3.8'
tox.env: py38

pypy2:
python.version: 'pypy2'
tox.env: pypy
pypy3:
python.version: 'pypy3'
tox.env: pypy3


Docs:
python.version: '3.7'
tox.env: docs
PyPI-Description:
python.version: '3.7'
tox.env: pypi-description
Changelog:
python.version: '3.7'
tox.env: changelog

steps:
- task: UsePythonVersion@0
displayName: Get Python for Python tools.
inputs:
versionSpec: '3.6'
addToPath: false
name: pyTools

- script: $(pyTools.pythonLocation)/bin/pip install --upgrade tox
displayName: Install Python-based tools.

- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
condition: not(in(variables['python.version'], '3.7', '3.8'))
displayName: Use cached Python $(python.version) for tests.

- script: |
sudo add-apt-repository ppa:deadsnakes
sudo apt-get update
sudo apt-get install -y --no-install-recommends python$(python.version)-dev python$(python.version)-distutils
condition: in(variables['python.version'], '3.7', '3.8')
displayName: Install Python $(python.version) from the deadsnakes PPA for tests.

- script: $(pyTools.pythonLocation)/bin/tox -e $(tox.env)
env:
TOX_AP_TEST_EXTRAS: azure-pipelines
displayName: run tox -e $(tox.env)

- script: |
if [ ! -f .coverage.* ]; then
echo No coverage data found.
exit 0
fi

# codecov shells out to "coverage" and avoiding 'sudo pip' allows for
# package caching.
PATH=$HOME/.local/bin:$PATH

case "$(python.version)" in
"pypy2") PY=pypy ;;
"pypy3") PY=pypy3 ;;
*) PY=python$(python.version) ;;
esac

# Python 3.8 needs an up-to-date pip.
if [ "$(python.version)" = "3.8" ]; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$PY get-pip.py --user
fi

$PY -m pip install --user coverage codecov

coverage combine
codecov
env:
CODECOV_TOKEN: $(codecov.token)
displayName: Report Coverage
condition: succeeded()
9 changes: 0 additions & 9 deletions changelog.d/425.change.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/443.change.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/450.change.rst

This file was deleted.

4 changes: 0 additions & 4 deletions changelog.d/482.breaking.rst

This file was deleted.

2 changes: 2 additions & 0 deletions changelog.d/504.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed deprecated ``Attribute`` attribute ``convert`` per scheduled removal on 2019/1.
This planned deprecation is tracked in issue `#307 <https://github.com/python-attrs/attrs/issues/307>`_.
1 change: 1 addition & 0 deletions changelog.d/517.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated ``attr.validators.__all__`` to include new validators added in `#425 <https://github.com/python-attrs/attrs/pull/425>`_.
1 change: 1 addition & 0 deletions changelog.d/522.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Slotted classes now use a pure Python mechanism to rewrite the ``__class__`` cell when rebuilding the class, so ``super()`` works even on environments where ``ctypes`` is not installed.
Loading