Commit Graph

50 Commits

Author SHA1 Message Date
Hynek Schlawack 2f63f2c5fe
Use isolated builds (#499)
* Use isolated builds

* try to upgrade all the things

* Try to upgrade only setuptools
2019-02-09 18:36:30 +01:00
Hynek Schlawack f8f4aef5a8 Revert isolated builds because they break mypy 2019-02-09 14:48:06 +01:00
Hynek Schlawack d4a002f64d try to fix build 2019-02-09 14:28:01 +01:00
Hynek Schlawack d21eed5165 Use isolated builds 2019-02-09 13:59:26 +01:00
Hynek Schlawack af35f2a57e RTD uses 3.5, so should we
We split up building of docs and doctest because RTD doesn't allow newer than
3.5 but we need up to date Python versions for our doctests.
2019-01-17 10:46:14 +01:00
Hynek Schlawack cfac7463c1 Fix deprecation warning for PyPI description check 2018-11-26 17:30:27 +01:00
Hynek Schlawack 3f59f08625 Fix double entry in pre-commit config 2018-11-26 12:58:39 +01:00
Hynek Schlawack a7db21a273 More pre-commit, more 3.7, more linting, more stages 2018-11-24 13:36:20 +01:00
Hynek Schlawack 290cf2a3f0 Quench a bunch of warnings 2018-10-19 10:48:09 +02:00
Chad Dombrova de104e016b Add PEP484 stubs (#238)
* Add PEP484 stubs

* Deploy .pyi stubs alongside .py files.

This is the recommended approach for 3rd party stubs.
See: https://github.com/python/typing/issues/84#issuecomment-317217346

* Add support for the new type argument.

* Add tests for stubs and address a few issues.

* Improve declaration of private vs public objects in stubs

* More stub tests

* Separate the stub tests into their own tox env

it does not make sense to test the stubs in multiple python *runtime* environments (e.g. python 3.5, 3.6, pypy3) because the results of static analysis wrt attrs is not dependent on the runtime.  Moreover, mypy is not installing correctly in pypy3 which has nothing to do with attrs.

* Update the manifest with stub files

* Remove mypy from the dev requirements

* Allow _CountingAttr to be instantiated, but not Attribute.

* Incorporate defaults into attr.ib typing

* Fix a bug with validators.and_

* Add more tests

* Remove _CountingAttr from public interface

It is crucial to ensure that make_class() works with attr.ib(), as a result we no longer have any functions that care about _CountingAttr.

* Lie about return type of Factory

this allows for an abbreviated idiom: `x: List[int] = Factory(list)`

* Add tox stubs env to travis

* used the wrong comment character in mypy tests

* Improve overloads using PyCharm order-based approach

overloads are pretty broken in mypy.  the best we can do for now is target PyCharm, which is much more forgiving.

* Remove features not yet working in mypy. Document remaining issues.

* Test stubs against euresti fork of mypy with attrs plugin

Copied the pytest plugin from mypy for testing annotations: It is not an officially supported API and using the plugin from mypy could break after any update.

* Add some types and TypeVars to some types. Make tests pass

* Suppress warnings about named attribute access from fields()

e.g.  fields(C).x
Eventually it would be good to add support for returning NamedTuple from the mypy plugin

* Add WIP mypy-doctest plugin

* Deal with a few remaining type issues in the docs

* sphinx doctest: don't turn warnings into errors.

doing so makes the tests abort after the first failed group.

* Update "type: ignore" comments to reflect issues fixed in mypy plugin

* doctest2: improve output formatting

* Update manifest

* static tests: use inline error declarations

* More tests

* Tests passing (with notes about remaining issues)

* Attempt to get latest plugin from euresti working

* Issues fixed.

Had to place calls to attr.ib under a class definition.

* Deal with a PyCharm bug

* Minor test improvements

* Make tests prettier

* Use 2 decorators instead of 3

* doctest2: add support for skipping mypy tests

* Add tests for inheritance, eq, and cmp

* Add fixmes and todos

* Rename convert to converter

* Attribute.validator is always a single validator

* Conform stubs to typeshed coding style

And add auto_attrib kw

* backport style fixes from typeshed

* Add test cases to cover forward references and Any

* Add fixes for forward references and Any

* Address typeshed review notes

* Use Sequence instead of List/Tuple for validator arg

list and tuple are invariant and so prevent passing subtypes of _ValidatorType

* backports changes from typeshed #1914

* backport changes from typeshed #1933

* Prevent mypy tests from getting picked up

Evidently the discovery rules changed recently for pytest.

* make our doctest extension compatible with latest sphinx

* Adjustments to the tests

* Fix flake and manifest tests (hopefully)

* Fix tests on pypy3 (hopefully)

* Update stubs from typeshed

Also update tests.

* Make PEP 561-compliant

* minor cleanup

* Consolidate stub support files into stub directory

In preparation for removing them from the pyi_stubs branch.

* Get tests passing

This is a final test of the current stubs before moving the stub tests to a new branch.

* Revert stub test additions

Replace with a simple mypy pass/fail test

* get pre-commit passing

* Address review feedback

* Move typing test up in tox envlist
2018-07-12 12:19:24 +02:00
Hynek Schlawack 2d71759098
Run on 3.7 proper (#405) 2018-07-05 07:39:16 +02:00
Hynek Schlawack e65ba7594d Remove lying comment 2018-06-23 12:02:51 +02:00
Hynek Schlawack 9278f8f942 Pull lint to the front for faster feedback
Also extras make no sense with skip_install=true
2018-06-16 10:41:45 +02:00
Hynek Schlawack a372d51b7b
Fade to Black (#392) 2018-06-10 19:40:07 +02:00
Łukasz Langa 29cc2abac8 Use `\\` instead of a single `\` in docstrings (#375)
* Use `\\` instead of a single `\` in docstrings

The latter is not an invalid escape and Python 3.6+ complains about it.  I also
updated tox.ini so that those warnings are visible in the future.

Fixes #351

* Make the config "forgetful dumbass"-proof
2018-04-28 23:42:00 +02:00
Hynek Schlawack 209c57993c Use tox's extras feature 2018-01-04 09:29:57 +01:00
Hynek Schlawack c601faf994 Use extras_require instead of dev-requirements.txt (#318)
* Use extras_require instead of dev-requirements.txt

* Better phrasing

* Make names reflects dir names, add docs

Keep docs-requirements.txt for now, but the plan is to get rid of it.

* Explain docs building
2017-12-29 16:11:47 +01:00
Hynek Schlawack ef9a062022
Use isort so we can stop thinking about imports (#297) 2017-11-26 22:18:07 +01:00
Hynek Schlawack 55ae1945b3 Move changelog to towncrier (#236) 2017-08-20 07:58:08 +02:00
Tin Tvrtković 47583a9459 Bugfix/slot super (#226) 2017-08-03 17:04:48 +02:00
Hynek Schlawack f8dab9b7ac Use VIRTUALENV_NO_DOWNLOAD in tox (#200) 2017-06-01 09:20:30 +02:00
Hynek Schlawack 617e443cef Use a docs-requirements.txt for RTD 2017-05-16 18:24:48 +02:00
Hynek Schlawack b988a85895 Pin sphinx to <1.6
1.6.1 fails with very confusing errors.  At this point not even sure it's our
fault.
2017-05-16 18:15:11 +02:00
Hynek Schlawack 96fc8cb815 Stop living in the past
...and move all aux tests to 3.6.
2017-03-04 07:52:33 +01:00
Hynek Schlawack 10cd1950cb We have a logo! 2017-02-20 13:41:20 +01:00
Tin Tvrtković 0d3cf3f624 Evolve and docs. (#135)
assoc is now deprecated in favor of evolve.
2017-01-21 17:11:45 +01:00
Hynek Schlawack cdfac7c400 Only run py27 and py35 under coverage
Hypothesis & Coverage together are a handbrake.
2016-09-12 07:54:22 +02:00
Hynek Schlawack adfdbf9560 Stop using deprecated APIs (#86)
Also use nicer exceptions that subclass the old ones.
2016-09-10 19:14:34 +02:00
Hynek Schlawack dd36808a5a Don't run PyPy under coverage
It's too slow and keeps breaking the tests.
2016-09-05 14:50:08 +02:00
Hynek Schlawack e833e0c1cd coverage 4.2 doesn't need a coverage erase anymore 2016-07-31 14:43:02 +02:00
Tin Tvrtković d10e5c41d6 asdict - propagate dict_factory properly (#45)
* asdict - propagate dict_factory properly. Hypothesis tests.

* Disable Hypothesis health checks on Travis/PyPy.

* Tox - pass the HYPOTHESIS_PROFILE environment variable.

* Shut up pytest again.
2016-06-02 15:40:15 -07:00
Tin Tvrtkovic f3ee6da7fc Try fixing Travis by removing a tox comment. 2016-05-16 22:55:55 +02:00
Hynek Schlawack 38bd2a7d0d Fix coverage reporting for Python 2 2016-02-20 09:40:26 +01:00
Hynek Schlawack 89b542331d Drop support for legacy Python versions
Keep 2.7 and PyPy though.
2016-02-17 12:51:02 +01:00
Hynek Schlawack 27cc283bed readme has been renamed 2016-01-06 14:03:55 +01:00
Hynek Schlawack 1f66134c0e Janitoring 2015-12-19 13:05:30 +01:00
Hynek Schlawack e6a2b99cd8 More janitoring 2015-12-08 16:00:06 +01:00
Hynek Schlawack 5d66e482d8 Repo janitoring 2015-12-08 15:47:03 +01:00
Hynek Schlawack 4c085a7dda Allow for posargs in tox 2015-10-18 11:53:46 +02:00
Hynek Schlawack a0c74621e8 Minor style 2015-10-16 15:18:18 +02:00
Hynek Schlawack 4c39a185ad Move package into src directory
Prevents accidental imports when running tests.
2015-10-16 15:11:10 +02:00
Hynek Schlawack f0b142382b Add Python 3.5 2015-09-22 10:41:38 +02:00
Hynek Schlawack 4855ad3651 Clean up setup.py 2015-08-11 11:16:21 +02:00
Hynek Schlawack fcd6e19932 Don't use setup.py test & pytest-cov
Mainly because the former doesn't use pip to install it's dependencies which
makes stuff potentially slow (no wheel caching) and litters the current directory.
2015-07-26 13:06:57 +02:00
Hynek Schlawack 043f4d55d7 Take class namespaces into account in repr
Also add an explicit option for Python 2.
2015-02-20 09:47:08 +01:00
Hynek Schlawack b29d9bb5f5 Fix example in README, add REAME to CI 2015-01-29 23:16:07 +01:00
Hynek Schlawack 8bb430cf18 Add basic support for zope.interface 2015-01-29 19:04:23 +01:00
Hynek Schlawack 3f2fd8317d More doc polishing 2015-01-28 16:55:45 +01:00
Hynek Schlawack c7381fd0e2 Gut docs for now 2015-01-27 23:03:04 +01:00
Hynek Schlawack 9560908555 Initial commit
Docs aren't there yet
2015-01-27 17:53:17 +01:00