Verified Commit c2fc967c authored by Georg Koppen's avatar Georg Koppen
Browse files

Merge branch 'm13'

parents 037493a7 1b1fbdbf
# core/tor releases:
# https://gitlab.torproject.org/tpo/core/team/-/wikis/NetworkTeam/CoreTorReleases
# As of 2021.03.02 all dirauths are running with version greater or equal to
# 0.4.5.
# 0.4.6 stable by Jun 15, 2021
# 0.4.7 stable by March 15, 2022
# 0.4.6 EOL on or after June 15, 2022
# 0.4.5 (LTS) EOL Feb 15, 2023
# 0.3.5 (LTS) EOL Feb 1, 2022
# Python releases:
# 3.10 stable by 2021-10-04: https://www.python.org/dev/peps/pep-0619/
# Python stable releases: https://www.python.org/downloads/
# 3.9 EOL 2025-10 PEP 596
# 3.8 EOL 2024-10 PEP 569, newest major release
# 3.7 EOL 2023-06-27 PEP 537, included in Debian bullseye (Debian stable from
# 2021-08-15)
# 3.6 EOL 2021-12-23 PEP 494
# 3.10 EOL 2026-10, PEP 619
# 3.9 EOL 2025-10, PEP 596
# 3.8 EOL 2024-10, PEP 569
# 3.7 EOL 2023-06-27, PEP 537
variables:
BASE_IMAGE: python:3.8
BASE_IMAGE: python:3.9
RELEASE: tor-nightly-main-bullseye
# Without version, the default available in the Debian repository will be
# installed.
......@@ -46,90 +41,72 @@ before_script:
after_script:
- tox -e stats
python36:
variables:
BASE_IMAGE: python:3.6
image: $BASE_IMAGE
script:
- tox -e py36
- tox -e integration
python37:
variables:
BASE_IMAGE: python:3.7
image: $BASE_IMAGE
script:
- tox -e py37
- tox -e integration
python38:
# This will overwrite the default before_script, so need to repeat the
# commands
before_script:
- "wget https://deb.torproject.org/torproject.org/\
A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc"
- cat A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | apt-key add -
- echo deb [signed-by=A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89]
http://deb.torproject.org/torproject.org $RELEASE
main >> /etc/apt/sources.list
- apt update -yqq
- apt install -yqq $TOR
- pip install tox
- python --version
- tor --version
# To build the docs
- apt install -yqq texlive-latex-extra
- apt install -yqq dvipng
image: $BASE_IMAGE
variables:
BASE_IMAGE: python:3.8
script:
- tox
- tox -e py38
- tox -e integration
python39tor045:
variables:
BASE_IMAGE: python:3.9
RELEASE: tor-nightly-0.4.5.x-bullseye
TOR: tor/tor-nightly-0.4.5.x-bullseye
image: $BASE_IMAGE
script:
- tox -e py39
- tox -e integration
python39tor046:
variables:
BASE_IMAGE: python:3.9
RELEASE: tor-nightly-0.4.6.x-bullseye
TOR: tor/tor-nightly-0.4.6.x-bullseye
image: $BASE_IMAGE
script:
- tox -e py39
- tox -e integration
python39tormaster:
variables:
BASE_IMAGE: python:3.9
image: $BASE_IMAGE
# This will overwrite the default before_script, so need to repeat the
# commands
before_script:
- "wget https://deb.torproject.org/torproject.org/\
A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc"
- cat A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | apt-key add -
- echo deb [signed-by=A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89]
http://deb.torproject.org/torproject.org $RELEASE
main >> /etc/apt/sources.list
- apt update -yqq
- apt install -yqq $TOR
- pip install tox
- python --version
- tor --version
# To build the docs
- apt install -yqq texlive-latex-extra
- apt install -yqq dvipng
script:
- tox -e py39
- tox -e integration
- tox
python39torstable:
variables:
BASE_IMAGE: python:3.9
RELEASE: bullseye
TOR: tor/bullseye
image: $BASE_IMAGE
script:
- tox -e py39
- tox -e integration
python310:
variables:
BASE_IMAGE: python:3.10-rc-bullseye
image: $BASE_IMAGE
BASE_IMAGE: python:3.10
script:
- tox -e py310
- tox -e integration
allow_failure: true
release_job:
before_script:
......
......@@ -23,12 +23,12 @@ System requirements
--------------------
- Tor (last stable version is recommended)
- Python 3 (>= 3.6)
- Python 3 (>= 3.7)
Python dependencies
--------------------
- Stem_ >= 1.7.0
- Stem_ >= 1.8.0
- Requests_ (with socks_ support) >= 2.10.0
It is recommend to install the dependencies from your system package manager.
......
[tool.black]
line-length = 79
target-version = ['py36', 'py37', 'py38']
target-version = ['py37', 'py38', 'py39', 'py310']
exclude = '''
/(
docs
......
......@@ -786,7 +786,7 @@ def process_completed_futures(executor, hbeat, result_dump, pending_results):
virtualMemoryInfo = psutil.virtual_memory()
availableMemory = virtualMemoryInfo.available
log.warning(
"Memory available %s MB.", availableMemory / 1024 ** 2
"Memory available %s MB.", availableMemory / 1024**2
)
dumpstacks()
else:
......
......@@ -569,7 +569,7 @@ def _validate_section_ports(conf, sec, ports, tmpl):
errors = []
section = conf[sec]
for key in ports:
valid, error = _validate_int(section, key, minimum=1, maximum=2 ** 16)
valid, error = _validate_int(section, key, minimum=1, maximum=2**16)
if not valid:
errors.append(
tmpl.substitute(
......
......@@ -47,7 +47,7 @@ def sbws_required_disk_space(conf):
v3bw_max_space_after_delete = (
space_v3bw_files_day * v3bw_compress_after_days
) + (size_compressed_files * num_v3bw_files_day * v3bw_delete_after_days)
text_dict["mb_bw"] = round(v3bw_max_space_after_delete / 1000 ** 2)
text_dict["mb_bw"] = round(v3bw_max_space_after_delete / 1000**2)
text_dict["d_bw"] = v3bw_delete_after_days
# default crontab configuration will run cleanup once a day
# default cleanup configuration will compress v3bw files after 1 day
......@@ -63,7 +63,7 @@ def sbws_required_disk_space(conf):
) + (
size_compressed_files * num_v3bw_files_day * results_delete_after_days
)
text_dict["mb_results"] = round(results_max_space_after_delete / 1000 ** 2)
text_dict["mb_results"] = round(results_max_space_after_delete / 1000**2)
text_dict["d_r"] = results_delete_after_days
# not counted rotated files and assuming that when it is not rotated the
# size will be approximately 10MiB
......@@ -75,10 +75,10 @@ def sbws_required_disk_space(conf):
text_dict["mb_log"] = space_log_files
# roughly, size of a current tor dir
size_tor_dir = 19828000
text_dict["mb_tor"] = round(size_tor_dir / 1000 ** 2)
text_dict["mb_tor"] = round(size_tor_dir / 1000**2)
# roughly, the size of this code and dependencies
size_code_deps = 2097152
text_dict["mb_code"] = round(size_code_deps / 1000 ** 2)
text_dict["mb_code"] = round(size_code_deps / 1000**2)
# Multiply per 2, just in case
size_total = (
results_max_space_after_delete
......@@ -87,7 +87,7 @@ def sbws_required_disk_space(conf):
+ size_tor_dir
+ size_code_deps
) * 2
text_dict["mb_total"] = round(size_total / 1000 ** 2)
text_dict["mb_total"] = round(size_total / 1000**2)
space_text = DISK_SPACE_TEXT.format(**text_dict)
return space_text
......@@ -96,7 +96,7 @@ def df(path):
# Not being used, since it makes a disk space system call and some
# systems might not allow it
"""Return space left on device where path is in MiB."""
return round(shutil.disk_usage(path).free / (1024 ** 2))
return round(shutil.disk_usage(path).free / (1024**2))
def is_low_space(conf):
......
......@@ -51,6 +51,12 @@ try:
except ImportError:
print("Please, install gitchangelog: `pip install gitchangelog`")
sys.exit(1)
# Not used directly, but gitchangelog depends on it
try:
import mako # noqa
except ImportError:
print("Please, install mako: `pip install mako`")
sys.exit(1)
import sbws
......
......@@ -19,10 +19,10 @@ classifiers =
Natural Language :: English
Operating System :: POSIX :: Linux
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
long_description = file: README.rst
license_files = LICENSE.rst
project_urls =
......@@ -34,10 +34,10 @@ project_urls =
packages = find:
include_package_data = True
# See stable releases at https://www.python.org/downloads/
python_requires = >= 3.6
python_requires = >= 3.7
install_requires =
psutil >= 5.5
stem >= 1.7.0
stem >= 1.8.0
; # Now versioneer is also needed as dependency
versioneer
requests[socks]
......
......@@ -174,7 +174,7 @@ def test_num_results_of_type(result_success, result_error_stream):
def assert_round_sig_dig_any_digits(n, result):
"""Test that rounding n to any reasonable number of significant digits
produces result."""
max_digits_int64 = int(math.ceil(math.log10(2 ** 64 - 1))) + 1
max_digits_int64 = int(math.ceil(math.log10(2**64 - 1))) + 1
for d in range(1, max_digits_int64 + 1):
assert round_sig_dig(n, digits=d) == result
......@@ -182,7 +182,7 @@ def assert_round_sig_dig_any_digits(n, result):
def assert_round_sig_dig_any_digits_error(n, elp_fraction=0.5):
"""Test that rounding n to any reasonable number of significant digits
produces a result within elp_fraction * 10.0 ** -(digits - 1)."""
max_digits_int64 = int(math.ceil(math.log10(2 ** 64 - 1))) + 1
max_digits_int64 = int(math.ceil(math.log10(2**64 - 1))) + 1
for d in range(1, max_digits_int64 + 1):
error_fraction = elp_fraction * (10.0 ** -(d - 1))
# use ceil rather than round, to work around floating-point inaccuracy
......@@ -259,21 +259,21 @@ def test_round_sig_dig():
assert_round_sig_dig_any_digits(10, 10)
# Large values
assert_round_sig_dig_any_digits_error(2 ** 30)
assert_round_sig_dig_any_digits_error(2 ** 31)
assert_round_sig_dig_any_digits_error(2 ** 32)
assert_round_sig_dig_any_digits_error(2**30)
assert_round_sig_dig_any_digits_error(2**31)
assert_round_sig_dig_any_digits_error(2**32)
# the floating-point accuracy limit for this function is 2**73
# on some machines
assert_round_sig_dig_any_digits_error(2 ** 62)
assert_round_sig_dig_any_digits_error(2 ** 63)
assert_round_sig_dig_any_digits_error(2 ** 64)
assert_round_sig_dig_any_digits_error(2**62)
assert_round_sig_dig_any_digits_error(2**63)
assert_round_sig_dig_any_digits_error(2**64)
# Out of range values: must round to 1
assert_round_sig_dig_any_digits(-0.01, 1)
assert_round_sig_dig_any_digits(-1, 1)
assert_round_sig_dig_any_digits(-10.5, 1)
assert_round_sig_dig_any_digits(-(2 ** 31), 1)
assert_round_sig_dig_any_digits(-(2**31), 1)
# test the transition points in the supported range
# testing the entire range up to 1 million takes 100s
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment