-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262813 from dotlambda/stem-python311
python311Packages.stem: enable on Python 3.11
- Loading branch information
Showing
1 changed file
with
33 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,51 @@ | ||
{ lib, buildPythonPackage, fetchPypi, python, mock, pythonAtLeast }: | ||
{ lib | ||
, buildPythonPackage | ||
, pythonOlder | ||
, fetchFromGitHub | ||
, setuptools | ||
, cryptography | ||
, mock | ||
, python | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "stem"; | ||
version = "1.8.2"; | ||
|
||
# As of May 2023, the master branch of stem contains fixes for Python 3.11 | ||
# that the last release (1.8.1) doesn't. The test suite fails on both master | ||
# and the 1.8.1 release, so disabling rather than switching to an unstable | ||
# source. | ||
disabled = pythonAtLeast "3.11"; | ||
disabled = pythonOlder "3.6"; | ||
|
||
src = fetchPypi { | ||
inherit pname version; | ||
hash = "sha256-g/sZ/9TJ+CIHwAYFFIA4n4CvIhp+R4MACu3sTjhOtYI="; | ||
pyproject = true; | ||
|
||
src = fetchFromGitHub { | ||
owner = "torproject"; | ||
repo = "stem"; | ||
rev = "refs/tags/${version}"; | ||
hash = "sha256-9BXeE/sVa13jr8G060aWjc49zgDVBhjaR6nt4lSxc0g="; | ||
}; | ||
|
||
postPatch = '' | ||
rm test/unit/installation.py | ||
sed -i "/test.unit.installation/d" test/settings.cfg | ||
# https://github.com/torproject/stem/issues/56 | ||
sed -i '/MOCK_VERSION/d' run_tests.py | ||
''; | ||
nativeBuildInputs = [ | ||
setuptools | ||
]; | ||
|
||
nativeCheckInputs = [ mock ]; | ||
nativeCheckInputs = [ | ||
cryptography | ||
mock | ||
]; | ||
|
||
checkPhase = '' | ||
touch .gitignore | ||
${python.interpreter} run_tests.py -u | ||
runHook preCheck | ||
${python.interpreter} run_tests.py --unit | ||
runHook postCheck | ||
''; | ||
|
||
meta = with lib; { | ||
changelog = "https://github.com/torproject/stem/blob/${src.rev}/docs/change_log.rst"; | ||
description = "Controller library that allows applications to interact with Tor"; | ||
downloadPage = "https://github.com/torproject/stem"; | ||
homepage = "https://stem.torproject.org/"; | ||
license = licenses.gpl3; | ||
maintainers = with maintainers; [ ]; | ||
license = licenses.lgpl3Only; | ||
maintainers = with maintainers; [ dotlambda ]; | ||
}; | ||
} |