Commit graph

198 commits

Author SHA1 Message Date
Alex Gaynor
7e62312797
Upgrade to pyo3 0.18 (#6935)
* Upgrade to pyo3 0.16

* Upgrade to pyo3 0.17

* Upgrade to pyo3 0.18
2023-03-24 21:23:13 +00:00
Alex Gaynor
7e19ff0229
Migrate from setup.cfg to pyproject.toml completely (#8116)
One less file?
2023-03-25 04:59:44 +08:00
Paul Kehrer
0794b0e31a
update MSRV 1.48.0 -> 1.56.0 (#8587)
* update MSRV 1.48.0 -> 1.56.0

* bump some deps for MSRV
2023-03-24 13:36:14 +00:00
Paul Kehrer
b5170bf26d
drop python 3.6 support (#8448)
* drop python 3.6 support

* Update tests/hazmat/bindings/test_openssl.py

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

---------

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2023-03-24 13:15:13 +00:00
Matthew Ryan
c5eb29860e
Python 3.6 compatibility fix. (#8516)
* Python 3.6 compatibility fix.

The capture_output argument to subprocess.run() was not introduced until
Python 3.7.  Use stdout=subprocess.PIPE and stderr=subprocess.PIPE instead,
which is equivalent.

* Update pyproject.toml

* Black

---------

Co-authored-by: Matthew Ryan <matt.ryan@nominum.com>
Co-authored-by: Paul Kehrer <paul.l.kehrer@gmail.com>
2023-03-15 06:47:58 -04:00
Alex Gaynor
6c39999b40
Ressurect the PoC of OpenSSL from Rust (#7164) 2023-03-15 13:06:16 +08:00
Alex Gaynor
d7d6b197ae
Error loudly if you somehow run setup.py without CFFI installed (#7640) 2022-09-23 08:22:54 -05:00
anthony sottile
59f60154d6
remove ext_package so top_level.txt is accurate in wheel metadata (#7511) 2022-08-15 10:44:13 -04:00
Hood Chatham
5c33dcac26
Add the rustc version to debug assistance output when setup.py fails (#7382)
* Add the rustc version to debug assistance output when setup.py fails

* Update setup.py

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>

* Apply formatter, better string manipulation

* Try again with string manipulation

* check=True

* apply formatter

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2022-06-28 22:07:56 +00:00
Alex Gaynor
bc00e8d676
Bump MSRV to 1.48.0 (#7128) 2022-04-27 13:47:46 +00:00
Paul Kehrer
6bc56acc25
update setup.py links to the canonical URL (#6284)
URL fragments don't work on the redirects anyway
2021-09-19 07:52:10 -04:00
Paul Kehrer
e703fb9f3a
Port most of setup.py to setup.cfg (#6239)
* try porting over setup.py config

* reduce duplication

* flake

* move long_description, remove more lines from setup.py
2021-08-29 17:38:34 -04:00
Christian Heimes
7eb9d5a7a3
Add more debug assistance (#6210)
Print Python version, platform, setuptools, pip, and setuptools_rust
on failed builds.

Signed-off-by: Christian Heimes <christian@python.org>
2021-08-17 09:07:32 -04:00
Alex Gaynor
82a12a54b6
Convert unpadding code to Rust (#5668) 2021-02-21 13:28:00 -06:00
Paul Kehrer
577e058798
Strict is deprecated (#5846)
* Strict is deprecated

* bump pytest dep
2021-02-18 17:57:43 -05:00
Alex Gaynor
7e30277483
Bump pyo3 and lower MSRV (#5823) 2021-02-13 13:35:56 -06:00
Alex Gaynor
f01dcd62af
Specify an MSRV in setup.py (#5789) 2021-02-08 18:09:31 -06:00
Alex Gaynor
5fdc9c1b85
More aggressively point people at Rust version docs (#5782) 2021-02-08 09:18:13 -06:00
Christian Heimes
048f7c6cb4
Remove setuptools_rust from install requirement (#5779)
* Remove setuptools_rust from install requirement

setuptools_rust is only required for building cryptography.

Fixes: https://github.com/pyca/cryptography/issues/5778
Signed-off-by: Christian Heimes <cheimes@redhat.com>

* sdist needs setuptools_rust

Signed-off-by: Christian Heimes <cheimes@redhat.com>
2021-02-08 09:32:58 -05:00
Alex Gaynor
ab537a610d
Try to assist folks having issues with older pips (#5757)
* Try to assist folks having issues with older pips

* Update setup.py

* Update setup.py
2021-02-07 15:06:02 -06:00
Alex Gaynor
c84d6ee060
Integrate Rust into the build process properly (#5410) 2020-12-22 13:33:47 -06:00
Alex Gaynor
149796628e
put pytest configuration somewhere that goes in the sdist (#5648)
fixes #5646
2020-12-15 08:42:34 -06:00
Paul Kehrer
137b432da0
xdist experiment (#5621)
* switch to xdist in tox for faster runs

* not using auto to avoid too many processes on local laptops
* we need to use pytest-cov to generate coverage properly now

* these env vars aren't present on no coverage builds

* tox changes
2020-12-10 16:51:05 -05:00
Alex Gaynor
da2879d387
remove check from setup.py that's not needed anymore (#5626)
pypy 7.2 is the oldest pypy that supports py3.6
2020-12-09 21:33:57 -06:00
Alex Gaynor
e66db8079d
Complete removal of py2 (#5533)
* Drop Python 2

* Black everything
2020-12-09 09:13:48 -06:00
Alex Gaynor
e0477596f7
Remove __future__ import from our code (#5610) 2020-12-09 00:35:11 -06:00
Alex Gaynor
b3540ec4a3
Write a bunch of primitives tests as subtests for performance (#5246) 2020-12-09 00:20:32 -06:00
Alex Gaynor
7d4e567e16
Switch black to py36 as the minimum version (#5608) 2020-12-08 23:40:21 -06:00
Alex Gaynor
ff12a37552
Remove Python2 from CI and code that branched on it (#5607)
* Remove Python2 from CI and code that branched on it

* Update setup.py

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

* remove

* review feedback

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-12-08 23:10:10 -06:00
Alex Gaynor
1be144acc6
bump cffi minimum version to help out pyopenssl (#5598)
fixes https://github.com/pyca/pyopenssl/issues/971
2020-12-01 13:01:43 -06:00
Alex Gaynor
96f2d96d1c
remove legacy debugging code from setup.py (#5597) 2020-12-01 12:23:39 -06:00
Paul Kehrer
66654d628d
print some stuff in setup.py to try to educate people (#5539)
This is likely futile, but maybe it will slightly help out people who
run into compilation errors and actually choose to look at the output.
2020-10-31 19:10:10 -04:00
Alex Gaynor
d9e174d3e1
Drop python 3.5 (#5527) 2020-10-28 07:38:42 -07:00
Paul Kehrer
0b2435940e
remove keywords with side effects hack in setup.py (#5426) 2020-08-25 11:28:08 -04:00
Paul Kehrer
ace8a92be9
remove idna support finally (#5351)
* remove idna support finally

* remove unused import
2020-07-26 13:07:31 -04:00
Alex Gaynor
60aa04481f
Paint it Black by the Rolling Stones (#5324) 2020-07-20 13:06:29 -05:00
Alex Gaynor
907ec96ee8
Disable parallel docs builds to fix spellcheck (#5287) 2020-06-26 09:01:52 -05:00
Alex Gaynor
33c2e55930
ban a sphinxcontrib-spelling version that breaks things (#5284)
* ban a sphinxcontrib-spelling version that breaks things

* try bumping the pypy3 version
2020-06-24 20:16:01 -05:00
Marko Kreen
0f8626093c
Support OpenSSH private key serialization format (#5146)
* ssh.py contains load/serialize code.
* Add PrivateFormat.OpenSSH to .private_bytes() format.
* Add load_ssh_private_key().
* Use new code for PublicFormat.OpenSSH too.
* load_ssh_public_key() now supports reading signed public keys.
* Supported algorithms: rsa, dsa, ec, ed25519.
* Optional dependency on 'bcrypt' package via [ssh] extra
2020-06-20 19:06:26 -05:00
Paul Kehrer
170599b87c
block another broken sphinx version (#5277) 2020-06-14 13:11:07 -04:00
Alex Gaynor
9dd4e1f2ce
Block a sphinx version that's broken (#5272) 2020-06-12 08:50:55 -05:00
Alex Gaynor
7dcd284c6e
Remove dead constant time code (#5239) 2020-04-26 17:19:57 -05:00
Paul Kehrer
d75335a7de drop python 3.4 support (#5087)
* drop python 3.4 support

Our dependencies have started dropping support so it is becoming
difficult to test. Additionally, Python 3.4 represents <2% of our
downloads, so taking on a large maintenance burden to maintain support
isn't a good use of limited time. Accordingly, we're dropping testing
infrastructure and migrating our abi3 wheels to py35+.

* use removed instead of dropped
2019-12-08 23:42:55 -05:00
Alex Gaynor
ae13fec7fc Fixes #5010 -- test and build 3.8 wheels (#5013)
* Fixes #5010 -- test and build 3.8 wheels

* try using isolated_build = True to work around a failure
2019-10-17 08:32:04 +08:00
David Benjamin
2d3b420383 Remove asn1crypto dependency (#4941)
* Remove non-test dependencies on asn1crypto.

cryptography.io actually contains two OpenSSL bindings right now, the
expected cffi one, and an optional one hidden in asn1crypto. asn1crypto
contains a lot of things that cryptography.io doesn't use, including a
BER parser and a hand-rolled and not constant-time EC implementation.

Instead, check in a much small DER-only parser in cryptography/hazmat. A
quick benchmark suggests this parser is also faster than asn1crypto:

  from __future__ import absolute_import, division, print_function
  import timeit

  print(timeit.timeit(
      "decode_dss_signature(sig)",
      setup=r"""
  from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
  sig=b"\x30\x2d\x02\x15\x00\xb5\xaf\x30\x78\x67\xfb\x8b\x54\x39\x00\x13\xcc\x67\x02\x0d\xdf\x1f\x2c\x0b\x81\x02\x14\x62\x0d\x3b\x22\xab\x50\x31\x44\x0c\x3e\x35\xea\xb6\xf4\x81\x29\x8f\x9e\x9f\x08"
  """,
      number=10000))

Python 2.7:
  asn1crypto: 0.25
  _der.py: 0.098

Python 3.5:
  asn1crypto: 0.17
  _der.py: 0.10

* Remove test dependencies on asn1crypto.

The remaining use of asn1crypto was some sanity-checking of
Certificates. Add a minimal X.509 parser to extract the relevant fields.

* Add a read_single_element helper function.

The outermost read is a little tedious.

* Address flake8 warnings

* Fix test for long-form vs short-form lengths.

Testing a zero length trips both this check and the non-minimal long
form check. Use a one-byte length to cover the missing branch.

* Remove support for negative integers.

These never come up in valid signatures. Note, however, this does
change public API.

* Update src/cryptography/hazmat/primitives/asymmetric/utils.py

Co-Authored-By: Alex Gaynor <alex.gaynor@gmail.com>

* Review comments

* Avoid hardcoding the serialization of NULL in decode_asn1.py too.
2019-07-28 12:06:40 -05:00
Alex Gaynor
ab115a9d19 Drop setup.py test support. (#4879)
* Drop setup.py test support.

It's fragile and relies on eggs. While our downstream redistributors don't love this (sorry!), it seems like the right tradeoff.

* Remove unused

* Added a changelog entry

* typo

* line length
2019-05-07 15:52:49 -04:00
Alex Gaynor
5fbc54ec05 Added an explicit content type for long_description (#4826)
It already defaults to x-rst, but this silences a warning
2019-04-01 13:04:04 +13:00
Paul Kehrer
3c68250ad9 allow bytes-like for key/iv/data for symmetric encryption (#4621)
* allow bytearrays for key/iv for symmetric encryption

* bump pypy/cffi requirements

* update docs, fix some tests

* old openssl is naught but pain

* revert a typo

* use trusty for old pypy

* better error msg again

* restore match
2018-12-09 23:13:31 -05:00
Paul Kehrer
7e422821b9 remove idna as a primary dependency (#4624)
* remove idna as a primary dependency

* empty commit

* dynamodb test fix (thanks to Matt Bullock)

* review feedback
2018-12-06 22:43:38 -05:00
Paul Kehrer
6d7b70e8f2 switch to twine check for verifying our readme renders on pypi (#4623) 2018-12-02 10:50:54 -05:00