PyFunceble-dev 4.2.15__py3-none-any.whl → 4.2.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1040,8 +1040,8 @@ def get_multiprocessing_group_data() -> List[Tuple[List[str], dict]]:
1040
1040
 
1041
1041
  available_cpu = os.cpu_count()
1042
1042
 
1043
- if available_cpu:
1044
- default_max_workers = available_cpu * 5
1043
+ if available_cpu is not None and available_cpu > 2:
1044
+ default_max_workers = available_cpu - 2
1045
1045
  else:
1046
1046
  default_max_workers = 1
1047
1047
 
@@ -1054,6 +1054,7 @@ def get_multiprocessing_group_data() -> List[Tuple[List[str], dict]]:
1054
1054
  {
1055
1055
  "dest": "cli_testing.max_workers",
1056
1056
  "type": int,
1057
+ "default": default_max_workers,
1057
1058
  "help": "Sets the number of maximal workers to use.\n"
1058
1059
  f"If not given, {default_max_workers} "
1059
1060
  "(based on the current machine) will be applied. %s"
@@ -60,6 +60,7 @@ import multiprocessing
60
60
  import os
61
61
  import secrets
62
62
  import sys
63
+ import time
63
64
  import traceback
64
65
  from typing import List, Optional, Union
65
66
 
@@ -636,6 +637,59 @@ class SystemLauncher(SystemBase):
636
637
  {"directory": protocol["output_dir"]}
637
638
  )
638
639
 
640
+ def handle_platform_contribution() -> None:
641
+ """
642
+ Assuming that we are testing a platform contribution, proceed with the
643
+ testing.
644
+ """
645
+
646
+ query_tool = CollectionQueryTool()
647
+
648
+ max_breakoff = 120.0
649
+ breakoff_multiplier = 0.5
650
+
651
+ initial_breakoff = (
652
+ PyFunceble.storage.CONFIGURATION.cli_testing.max_workers
653
+ * breakoff_multiplier
654
+ )
655
+ breakoff = initial_breakoff
656
+
657
+ while True:
658
+ for next_contract in next(
659
+ query_tool.pull_contract(
660
+ PyFunceble.storage.CONFIGURATION.cli_testing.max_workers
661
+ )
662
+ ):
663
+ if "subject" not in next_contract or not next_contract["subject"]:
664
+ continue
665
+
666
+ protocol_data = copy.deepcopy(protocol)
667
+
668
+ protocol_data["checker_type"] = next_contract[
669
+ "checker_type"
670
+ ].upper()
671
+ protocol_data["subject_type"] = next_contract["subject_type"]
672
+ protocol_data["subject"] = protocol_data["idna_subject"] = (
673
+ next_contract["subject"]["subject"]
674
+ )
675
+ protocol_data["contract"] = copy.deepcopy(next_contract)
676
+
677
+ self.tester_process_manager.add_to_input_queue(
678
+ protocol_data, worker_name="main"
679
+ )
680
+
681
+ self.ci_stop_in_the_middle_if_time_exceeded()
682
+
683
+ if PyFunceble.storage.CONFIGURATION.cli_testing.display_mode.dots:
684
+ PyFunceble.cli.utils.stdout.print_single_line("S")
685
+
686
+ time.sleep(breakoff)
687
+
688
+ if breakoff < max_breakoff:
689
+ breakoff += 0.02
690
+ else:
691
+ breakoff = initial_breakoff
692
+
639
693
  for protocol in self.testing_protocol:
640
694
  self.ci_stop_in_the_middle_if_time_exceeded()
641
695
 
@@ -665,39 +719,7 @@ class SystemLauncher(SystemBase):
665
719
  elif protocol["type"] == "file":
666
720
  handle_file(protocol)
667
721
  elif protocol["type"] == "platform-contribution":
668
- query_tool = CollectionQueryTool()
669
-
670
- while True:
671
- for next_contract in next(
672
- query_tool.pull_contract(
673
- PyFunceble.storage.CONFIGURATION.cli_testing.max_workers
674
- )
675
- ):
676
- if (
677
- "subject" not in next_contract
678
- or not next_contract["subject"]
679
- ):
680
- continue
681
-
682
- protocol_data = copy.deepcopy(protocol)
683
-
684
- protocol_data["checker_type"] = next_contract[
685
- "checker_type"
686
- ].upper()
687
- protocol_data["subject_type"] = next_contract["subject_type"]
688
- protocol_data["subject"] = protocol_data["idna_subject"] = (
689
- next_contract["subject"]["subject"]
690
- )
691
- protocol_data["contract"] = copy.deepcopy(next_contract)
692
-
693
- self.tester_process_manager.add_to_input_queue(
694
- protocol_data, worker_name="main"
695
- )
696
-
697
- self.ci_stop_in_the_middle_if_time_exceeded()
698
-
699
- if PyFunceble.storage.CONFIGURATION.cli_testing.display_mode.dots:
700
- PyFunceble.cli.utils.stdout.print_single_line()
722
+ handle_platform_contribution()
701
723
  return self
702
724
 
703
725
  def generate_waiting_files(self) -> "SystemLauncher":
@@ -146,6 +146,10 @@ class CollectionQueryTool:
146
146
  else:
147
147
  self.guess_and_set_timeout()
148
148
 
149
+ self._url_base = EnvironmentVariableHelper(
150
+ "PYFUNCEBLE_COLLECTION_API_URL"
151
+ ).get_value(default=None)
152
+
149
153
  self.session = requests.Session()
150
154
  self.session.headers.update(
151
155
  {
@@ -513,6 +517,9 @@ class CollectionQueryTool:
513
517
 
514
518
  PyFunceble.facility.Logger.info("Starting to pull next contract")
515
519
 
520
+ if not isinstance(amount, int) or amount < 1:
521
+ amount = 1
522
+
516
523
  url = f"{self.url_base}/v1/contracts/next"
517
524
  params = {
518
525
  "limit": amount,
@@ -536,8 +543,10 @@ class CollectionQueryTool:
536
543
  PyFunceble.facility.Logger.info("Finished to pull next contract")
537
544
 
538
545
  yield response_json
546
+ else:
547
+ response_json = []
539
548
  except (requests.RequestException, json.decoder.JSONDecodeError):
540
- response_json = [{"subject": {}}]
549
+ response_json = []
541
550
 
542
551
  PyFunceble.facility.Logger.debug(
543
552
  "Failed to pull next contract. Response: %r", response_json
PyFunceble/storage.py CHANGED
@@ -61,7 +61,7 @@ from dotenv import load_dotenv
61
61
  from PyFunceble.storage_facility import get_config_directory
62
62
 
63
63
  PROJECT_NAME: str = "PyFunceble"
64
- PROJECT_VERSION: str = "4.2.15.dev (Blue Duckling: Ixora)"
64
+ PROJECT_VERSION: str = "4.2.17.dev (Blue Duckling: Ixora)"
65
65
 
66
66
  DISTRIBUTED_CONFIGURATION_FILENAME: str = ".PyFunceble_production.yaml"
67
67
  DISTRIBUTED_DIR_STRUCTURE_FILENAME: str = "dir_structure_production.json"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyFunceble-dev
3
- Version: 4.2.15
3
+ Version: 4.2.17
4
4
  Summary: The tool to check the availability or syntax of domain, IP or URL.
5
5
  Home-page: https://github.com/funilrys/PyFunceble
6
6
  Author: funilrys
@@ -21,77 +21,77 @@ Classifier: Programming Language :: Python :: 3
21
21
  Classifier: License :: OSI Approved
22
22
  Requires-Python: >=3.8, <4
23
23
  License-File: LICENSE
24
- Requires-Dist: colorama
25
- Requires-Dist: PyYAML
26
- Requires-Dist: setuptools >=65.5.1
27
- Requires-Dist: domain2idna ~=1.12.0
28
- Requires-Dist: inflection
29
- Requires-Dist: requests[socks] <3
30
- Requires-Dist: packaging
31
24
  Requires-Dist: SQLAlchemy ~=2.0
32
25
  Requires-Dist: python-box[all] ~=6.0.0
33
- Requires-Dist: python-dotenv
26
+ Requires-Dist: setuptools >=65.5.1
27
+ Requires-Dist: packaging
34
28
  Requires-Dist: shtab
35
- Requires-Dist: cryptography ~=42.0
36
- Requires-Dist: alembic
29
+ Requires-Dist: requests[socks] <3
30
+ Requires-Dist: PyYAML
37
31
  Requires-Dist: PyMySQL
32
+ Requires-Dist: domain2idna ~=1.12.0
38
33
  Requires-Dist: dnspython[doh] ~=2.6.0
34
+ Requires-Dist: colorama
35
+ Requires-Dist: python-dotenv
36
+ Requires-Dist: inflection
37
+ Requires-Dist: cryptography ~=42.0
38
+ Requires-Dist: alembic
39
39
  Provides-Extra: dev
40
40
  Requires-Dist: black ; extra == 'dev'
41
+ Requires-Dist: isort ; extra == 'dev'
41
42
  Requires-Dist: pylint ; extra == 'dev'
42
43
  Requires-Dist: flake8 ; extra == 'dev'
43
- Requires-Dist: isort ; extra == 'dev'
44
44
  Provides-Extra: docs
45
- Requires-Dist: sphinx >=3.4.3 ; extra == 'docs'
46
45
  Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
47
- Requires-Dist: Pygments >=2.0 ; extra == 'docs'
48
46
  Requires-Dist: alabaster <0.8,>=0.7 ; extra == 'docs'
47
+ Requires-Dist: sphinx >=3.4.3 ; extra == 'docs'
48
+ Requires-Dist: Pygments >=2.0 ; extra == 'docs'
49
49
  Provides-Extra: full
50
- Requires-Dist: domain2idna ~=1.12.0 ; extra == 'full'
51
- Requires-Dist: inflection ; extra == 'full'
50
+ Requires-Dist: SQLAlchemy ~=2.0 ; extra == 'full'
51
+ Requires-Dist: setuptools >=65.5.1 ; extra == 'full'
52
+ Requires-Dist: black ; extra == 'full'
53
+ Requires-Dist: PyMySQL ; extra == 'full'
54
+ Requires-Dist: dnspython[doh] ~=2.6.0 ; extra == 'full'
52
55
  Requires-Dist: coverage ; extra == 'full'
53
- Requires-Dist: shtab ; extra == 'full'
54
- Requires-Dist: cryptography ~=42.0 ; extra == 'full'
55
- Requires-Dist: flake8 ; extra == 'full'
56
56
  Requires-Dist: alabaster <0.8,>=0.7 ; extra == 'full'
57
+ Requires-Dist: inflection ; extra == 'full'
58
+ Requires-Dist: cryptography ~=42.0 ; extra == 'full'
57
59
  Requires-Dist: sphinx >=3.4.3 ; extra == 'full'
58
- Requires-Dist: colorama ; extra == 'full'
59
- Requires-Dist: python-dotenv ; extra == 'full'
60
- Requires-Dist: black ; extra == 'full'
61
- Requires-Dist: PyMySQL ; extra == 'full'
62
- Requires-Dist: alembic ; extra == 'full'
63
- Requires-Dist: pylint ; extra == 'full'
64
- Requires-Dist: tox ; extra == 'full'
65
- Requires-Dist: setuptools >=65.5.1 ; extra == 'full'
60
+ Requires-Dist: PyYAML ; extra == 'full'
66
61
  Requires-Dist: isort ; extra == 'full'
67
62
  Requires-Dist: sphinx-rtd-theme ; extra == 'full'
68
- Requires-Dist: PyYAML ; extra == 'full'
69
- Requires-Dist: requests[socks] <3 ; extra == 'full'
70
- Requires-Dist: SQLAlchemy ~=2.0 ; extra == 'full'
71
- Requires-Dist: packaging ; extra == 'full'
72
63
  Requires-Dist: python-box[all] ~=6.0.0 ; extra == 'full'
64
+ Requires-Dist: requests[socks] <3 ; extra == 'full'
73
65
  Requires-Dist: Pygments >=2.0 ; extra == 'full'
74
- Requires-Dist: dnspython[doh] ~=2.6.0 ; extra == 'full'
66
+ Requires-Dist: flake8 ; extra == 'full'
67
+ Requires-Dist: pylint ; extra == 'full'
68
+ Requires-Dist: colorama ; extra == 'full'
69
+ Requires-Dist: python-dotenv ; extra == 'full'
70
+ Requires-Dist: packaging ; extra == 'full'
71
+ Requires-Dist: shtab ; extra == 'full'
72
+ Requires-Dist: domain2idna ~=1.12.0 ; extra == 'full'
73
+ Requires-Dist: tox ; extra == 'full'
74
+ Requires-Dist: alembic ; extra == 'full'
75
75
  Provides-Extra: psql
76
- Requires-Dist: colorama ; extra == 'psql'
77
- Requires-Dist: PyYAML ; extra == 'psql'
78
- Requires-Dist: setuptools >=65.5.1 ; extra == 'psql'
79
- Requires-Dist: domain2idna ~=1.12.0 ; extra == 'psql'
80
- Requires-Dist: inflection ; extra == 'psql'
81
- Requires-Dist: requests[socks] <3 ; extra == 'psql'
82
- Requires-Dist: packaging ; extra == 'psql'
83
76
  Requires-Dist: SQLAlchemy ~=2.0 ; extra == 'psql'
84
77
  Requires-Dist: python-box[all] ~=6.0.0 ; extra == 'psql'
85
- Requires-Dist: python-dotenv ; extra == 'psql'
86
78
  Requires-Dist: psycopg2 ; extra == 'psql'
79
+ Requires-Dist: setuptools >=65.5.1 ; extra == 'psql'
80
+ Requires-Dist: packaging ; extra == 'psql'
87
81
  Requires-Dist: shtab ; extra == 'psql'
88
- Requires-Dist: cryptography ~=42.0 ; extra == 'psql'
89
- Requires-Dist: alembic ; extra == 'psql'
82
+ Requires-Dist: requests[socks] <3 ; extra == 'psql'
83
+ Requires-Dist: PyYAML ; extra == 'psql'
90
84
  Requires-Dist: PyMySQL ; extra == 'psql'
85
+ Requires-Dist: domain2idna ~=1.12.0 ; extra == 'psql'
91
86
  Requires-Dist: dnspython[doh] ~=2.6.0 ; extra == 'psql'
87
+ Requires-Dist: colorama ; extra == 'psql'
88
+ Requires-Dist: python-dotenv ; extra == 'psql'
89
+ Requires-Dist: inflection ; extra == 'psql'
90
+ Requires-Dist: cryptography ~=42.0 ; extra == 'psql'
91
+ Requires-Dist: alembic ; extra == 'psql'
92
92
  Provides-Extra: test
93
- Requires-Dist: coverage ; extra == 'test'
94
93
  Requires-Dist: tox ; extra == 'test'
94
+ Requires-Dist: coverage ; extra == 'test'
95
95
 
96
96
  .. image:: https://raw.githubusercontent.com/PyFunceble/logo/dev/Green/HD/RM.png
97
97
 
@@ -4,7 +4,7 @@ PyFunceble/facility.py,sha256=zwQ-5JFtBr-n0uahkCLIheXNADX34A3uzVcEdFTWT8o,2640
4
4
  PyFunceble/factory.py,sha256=EIMObS1gaWpGamlqIoLoHAg9xpcXdfKEnDGe31O9WIw,2590
5
5
  PyFunceble/logger.py,sha256=8ex6ccGeV8sXtF6MMZsIfCAv2ZJmwKrvRQZd_4cIDCM,16829
6
6
  PyFunceble/sessions.py,sha256=lmqepbwtCCU8KVBNZ-XBo6kFFh5cpCKPgT_GegiLhk8,2582
7
- PyFunceble/storage.py,sha256=CQMhO1zle3RMkzLe__UOUtLIXSRPz0maw--aFsHdH7M,6299
7
+ PyFunceble/storage.py,sha256=LYiE_iBIG1-mEyrayYXMxfwIdtw_qHYeqLXpLIj7GRM,6299
8
8
  PyFunceble/storage_facility.py,sha256=dnjRkVbH3kFtbWlX7evPyNT6rfo7nGCd4oNC9AajWtY,4833
9
9
  PyFunceble/checker/__init__.py,sha256=aiQBstQTw1nXwZ3IGxf_k3CofRbbtFB4WAu_ezvmi_0,2444
10
10
  PyFunceble/checker/base.py,sha256=iFNezdMIpfx6kwEaaDzniP7erPEbHWsBsIIMG96MAEY,13677
@@ -72,7 +72,7 @@ PyFunceble/cli/entry_points/production.py,sha256=duhH99ODUqoprwbkbgy9dFK2YZQXrGj
72
72
  PyFunceble/cli/entry_points/public_suffix.py,sha256=n1hNZy3G1jHYWEyu0qUppYu2nqe8aTF705x-uhCMUjo,4346
73
73
  PyFunceble/cli/entry_points/pyfunceble/__init__.py,sha256=X1LHl80LraiZQ7yfB15y-5ohJksTHOBwuQcXO50fx5w,2499
74
74
  PyFunceble/cli/entry_points/pyfunceble/argsparser.py,sha256=3pmbCfTg-im_eVdEMvzg-foethjFoKJpTKrdlkuUnIA,4762
75
- PyFunceble/cli/entry_points/pyfunceble/cli.py,sha256=f63sSKXFu2ZZklA8FRq_IfDXGpd78CcZlvyEeLe8Csk,47640
75
+ PyFunceble/cli/entry_points/pyfunceble/cli.py,sha256=l5ukWMt1BsNayMqPmPxRzWcvxUa0raGnbNdhRQzW5mY,47722
76
76
  PyFunceble/cli/filesystem/__init__.py,sha256=sGS4B1rWA5BJLhWVBWzSy2yGX7zzgzyTW8tyEV9RK9k,2497
77
77
  PyFunceble/cli/filesystem/cleanup.py,sha256=AHisLr_f8vCCO9LV90yLGnzW4NWeYYYnQAcE6OKQVMo,4827
78
78
  PyFunceble/cli/filesystem/counter.py,sha256=GXfBL3II6-s_egVH32LwaSp74mA7pxILqaeLhrHZQtE,6977
@@ -137,7 +137,7 @@ PyFunceble/cli/scripts/public_suffix.py,sha256=-xYAQVv2ug_2Uk7-VoEkVyEHqP5Crmj8C
137
137
  PyFunceble/cli/system/__init__.py,sha256=4jXK5yT6fDjsbNg5LULnpfJ8G1yM_uP78-OLkPM1Skc,2522
138
138
  PyFunceble/cli/system/base.py,sha256=E3TsC7y0qrL7hhLLAlaUhFWU9etTbOKOuqIrDSCeRqA,4888
139
139
  PyFunceble/cli/system/integrator.py,sha256=P4lJvHWQnTFkC4chYXJBOCF4BuFQUz6199x8u6COOwI,9676
140
- PyFunceble/cli/system/launcher.py,sha256=k592db_pf_u2Fjt-soRXs9JPwVh-mT8Lq6FH8fjY8iM,44933
140
+ PyFunceble/cli/system/launcher.py,sha256=sfNLyEuP74ZLdTKS_tiDlith9obeT5Nk2QEeyrEkZnA,45466
141
141
  PyFunceble/cli/utils/__init__.py,sha256=69PJomADQHaFLgnfTpS7SFTgVkqZiRdvpUKX41nUuXs,2465
142
142
  PyFunceble/cli/utils/ascii_logo.py,sha256=Zff57bUS-2GkjAzyv6OEpw8THrolr0rhjjvjepsMgR8,4236
143
143
  PyFunceble/cli/utils/sort.py,sha256=Vi2V4S55hbqP9Mrk_OsYxESKAnKIS6DOFZ7nZXEv7u4,4375
@@ -242,7 +242,7 @@ PyFunceble/helpers/list.py,sha256=42SX78D6cbUbSctxBZLE-kBzJmBQ3iZTDQiB7Ficfkk,50
242
242
  PyFunceble/helpers/merge.py,sha256=qU9z5mUGxNEKv2fjPokSU8B-HMC62izEIk8LZQU9duE,6060
243
243
  PyFunceble/helpers/regex.py,sha256=ySrV2FaKJPVL4glaA1jx2_1Jq_5ydup86FWrRsfB7eo,6937
244
244
  PyFunceble/query/__init__.py,sha256=OrSc30ozkbsgboBkO3IWmsHZS3AxhnvfQuJLZlnbhoI,2514
245
- PyFunceble/query/collection.py,sha256=1QxYGMdeLuPEa1FrU2E4_kBb5eliOqznQsLhdXH5_ws,25626
245
+ PyFunceble/query/collection.py,sha256=xqP4-fA9lYEMtD58wfrqCd2t_gzNVVkpjz4YoMPvqsE,25873
246
246
  PyFunceble/query/http_status_code.py,sha256=Li6uWA-GLJ0Hj_dKz527w4i4gLX78W-AC87MeVdDJdI,11777
247
247
  PyFunceble/query/dns/__init__.py,sha256=Q0M83ZMZf7wJMgTVFmnXyfLb8XNdBHe2gTWs2dHTpK4,2479
248
248
  PyFunceble/query/dns/nameserver.py,sha256=ogE6jXBOy94f36KtUx4y1kB_G2H_X65SJWTzuaTbVDI,9796
@@ -274,9 +274,9 @@ PyFunceble/utils/__init__.py,sha256=l6Mz-0GPHPCSPXuNFtHbnjD0fYI5BRr-RwDbVgAUdmI,
274
274
  PyFunceble/utils/platform.py,sha256=px_pauOFMCEtc9ST0vYZvDWDhcWNP1S595iKK4P3n7c,3920
275
275
  PyFunceble/utils/profile.py,sha256=Fp5yntq5Ys5eQe-FbQsUpx4ydxDxVYW3ACn-3KcTk_A,4566
276
276
  PyFunceble/utils/version.py,sha256=Tb3DWk96Xl6WbdDa2t3QQGBBDcnKDNJV_iFWMVQfCoc,8330
277
- PyFunceble_dev-4.2.15.dist-info/LICENSE,sha256=JBG6UfPnf3940AtwZB6vwAK6YH82Eo6nzMVnjGqopF0,10796
278
- PyFunceble_dev-4.2.15.dist-info/METADATA,sha256=PUAL2ODPxPOVjhu6bqZtkrjDXm36AyW7VYQSII8yAkk,15119
279
- PyFunceble_dev-4.2.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
280
- PyFunceble_dev-4.2.15.dist-info/entry_points.txt,sha256=Ic1suwopOi_XTgiQi2ErtpY5xT3R8EFMI6B_ONDuR9E,201
281
- PyFunceble_dev-4.2.15.dist-info/top_level.txt,sha256=J7GBKIiNYv93m1AxLy8_gr6ExXyZbMmCVXHMQBTUq2Y,11
282
- PyFunceble_dev-4.2.15.dist-info/RECORD,,
277
+ PyFunceble_dev-4.2.17.dist-info/LICENSE,sha256=JBG6UfPnf3940AtwZB6vwAK6YH82Eo6nzMVnjGqopF0,10796
278
+ PyFunceble_dev-4.2.17.dist-info/METADATA,sha256=Od6t4Pc9xoj5SZao9wHOPH4yG8cqvleS-UQdCHL5j0I,15119
279
+ PyFunceble_dev-4.2.17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
280
+ PyFunceble_dev-4.2.17.dist-info/entry_points.txt,sha256=Ic1suwopOi_XTgiQi2ErtpY5xT3R8EFMI6B_ONDuR9E,201
281
+ PyFunceble_dev-4.2.17.dist-info/top_level.txt,sha256=J7GBKIiNYv93m1AxLy8_gr6ExXyZbMmCVXHMQBTUq2Y,11
282
+ PyFunceble_dev-4.2.17.dist-info/RECORD,,