You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2023/04/18 11:29:49 UTC

[buildstream] 02/02: Revert "Drop support for Python 3.6"

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/support-py36
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit c5d5b2c6d6ac8827a8b315940e0afbb2a0167457
Author: Tristan van Berkom <tr...@upstairslabs.com>
AuthorDate: Tue Apr 18 20:29:08 2023 +0900

    Revert "Drop support for Python 3.6"
    
    This reverts commit d5774cd0fc0e4a99a00c5ab2cd3a4dd4b83935dc.
    
    Bring back 3.6 support !
---
 .github/common.env          |  4 ++--
 NEWS                        |  2 +-
 setup.py                    |  5 +++--
 src/buildstream/_project.py |  6 +++++-
 tox.ini                     | 44 ++++++++++++++++++++------------------------
 5 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/.github/common.env b/.github/common.env
index 598896cc0..ef662c0e5 100644
--- a/.github/common.env
+++ b/.github/common.env
@@ -1,6 +1,6 @@
 # Shared common variables
 
 CI_IMAGE_VERSION=master-643533272
-CI_TOXENV_MAIN=py37,py38,py39,py310,py311
-CI_TOXENV_PLUGINS=py37-plugins,py38-plugins,py39-plugins,py310-plugins,py311-plugins
+CI_TOXENV_MAIN=py36,py37,py38,py39,py310,py311
+CI_TOXENV_PLUGINS=py36-plugins,py37-plugins,py38-plugins,py39-plugins,py310-plugins,py311-plugins
 CI_TOXENV_ALL="${CI_TOXENV_MAIN},${CI_TOXENV_PLUGINS}"
diff --git a/NEWS b/NEWS
index 0f69cc034..39a2c0b60 100644
--- a/NEWS
+++ b/NEWS
@@ -155,7 +155,7 @@ buildstream 1.95.0
 
 Core
 ----
-  o BuildStream now requires Python >= 3.7 and also supports Python 3.10.
+  o BuildStream now also supports Python 3.10.
 
 
 API
diff --git a/setup.py b/setup.py
index 017b046f3..0d2e67ded 100755
--- a/setup.py
+++ b/setup.py
@@ -84,10 +84,10 @@ if version.startswith("0+untagged"):
 # Python requirements
 ##################################################################
 REQUIRED_PYTHON_MAJOR = 3
-REQUIRED_PYTHON_MINOR = 7
+REQUIRED_PYTHON_MINOR = 6
 
 if sys.version_info[0] != REQUIRED_PYTHON_MAJOR or sys.version_info[1] < REQUIRED_PYTHON_MINOR:
-    print("BuildStream requires Python >= 3.7")
+    print("BuildStream requires Python >= 3.6")
     sys.exit(1)
 
 try:
@@ -408,6 +408,7 @@ setup(
         "License :: OSI Approved :: Apache Software License",
         "Operating System :: POSIX",
         "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 1a1054898..2f01f4477 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -18,6 +18,7 @@
 from typing import TYPE_CHECKING, Optional, Dict, Union, List
 
 import os
+import sys
 import urllib.parse
 from pathlib import Path
 from pluginbase import PluginBase
@@ -283,7 +284,10 @@ class Project:
             )
 
         try:
-            full_resolved_path = full_path.resolve(strict=True)
+            if sys.version_info[0] == 3 and sys.version_info[1] < 6:
+                full_resolved_path = full_path.resolve()
+            else:
+                full_resolved_path = full_path.resolve(strict=True)  # pylint: disable=unexpected-keyword-arg
         except FileNotFoundError:
             provenance = node.get_provenance()
             raise LoadError(
diff --git a/tox.ini b/tox.ini
index df878d884..3a52aeb1d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@
 # Tox global configuration
 #
 [tox]
-envlist = py{37,38,39,310,311}
+envlist = py{36,37,38,39,310,311}
 skip_missing_interpreters = true
 isolated_build = true
 
@@ -33,30 +33,30 @@ BST_PLUGINS_VERSION = ed65975aa3b0629a36112d474366ac86d4da8261
 [testenv]
 usedevelop =
     # This is required by Cython in order to get coverage for cython files.
-    py{37,38,39,310,311}-!nocover: True
+    py{36,37,38,39,310,311}-!nocover: True
 
 commands =
     # Running with coverage reporting enabled
-    py{37,38,39,310,311}-!plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
+    py{36,37,38,39,310,311}-!plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs}
     # Running with coverage reporting disabled
-    py{37,38,39,310,311}-!plugins-nocover: pytest --basetemp {envtmpdir} {posargs}
+    py{36,37,38,39,310,311}-!plugins-nocover: pytest --basetemp {envtmpdir} {posargs}
     # Running external plugins tests with coverage reporting enabled
-    py{37,38,39,310,311}-plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc --plugins {posargs}
+    py{36,37,38,39,310,311}-plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc --plugins {posargs}
     # Running external plugins tests with coverage disabled
-    py{37,38,39,310,311}-plugins-nocover: pytest --basetemp {envtmpdir} --plugins {posargs}
+    py{36,37,38,39,310,311}-plugins-nocover: pytest --basetemp {envtmpdir} --plugins {posargs}
 commands_post:
-    py{37,38,39,310,311}-!nocover: mkdir -p .coverage-reports
-    py{37,38,39,310,311}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
+    py{36,37,38,39,310,311}-!nocover: mkdir -p .coverage-reports
+    py{36,37,38,39,310,311}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
 deps =
-    py{37,38,39,310,311}: -rrequirements/requirements.txt
-    py{37,38,39,310,311}: -rrequirements/dev-requirements.txt
-    py{37,38,39,310,311}: git+https://github.com/apache/buildstream-plugins.git@{env:BST_PLUGINS_VERSION:{[config]BST_PLUGINS_VERSION}}
+    py{36,37,38,39,310,311}: -rrequirements/requirements.txt
+    py{36,37,38,39,310,311}: -rrequirements/dev-requirements.txt
+    py{36,37,38,39,310,311}: git+https://github.com/apache/buildstream-plugins.git@{env:BST_PLUGINS_VERSION:{[config]BST_PLUGINS_VERSION}}
 
     # Install local sample plugins for testing pip plugin origins
-    py{37,38,39,310,311}: {toxinidir}/tests/plugins/sample-plugins
+    py{36,37,38,39,310,311}: {toxinidir}/tests/plugins/sample-plugins
 
     # Install external plugins for plugin tests
-    py{37,38,39,310,311}-plugins: git+https://gitlab.com/buildstream/bst-plugins-experimental.git@{env:BST_PLUGINS_EXPERIMENTAL_VERSION:{[config]BST_PLUGINS_EXPERIMENTAL_VERSION}}#egg=bst_plugins_experimental[deb]
+    py{36,37,38,39,310,311}-plugins: git+https://gitlab.com/buildstream/bst-plugins-experimental.git@{env:BST_PLUGINS_EXPERIMENTAL_VERSION:{[config]BST_PLUGINS_EXPERIMENTAL_VERSION}}#egg=bst_plugins_experimental[deb]
 
     # Only require coverage and pytest-cov when using it
     !nocover: -rrequirements/cov-requirements.txt
@@ -84,21 +84,17 @@ passenv =
 # These keys are not inherited by any other sections
 #
 setenv =
-    py{37,38,39,310,311}: COVERAGE_FILE = {envtmpdir}/.coverage
-    py{37,38,39,310,311}: BST_TEST_HOME = {envtmpdir}
-    py{37,38,39,310,311}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache
-    py{37,38,39,310,311}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config
-    py{37,38,39,310,311}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share
-
-    # This is required to run tests with python 3.7
-    py37: SETUPTOOLS_ENABLE_FEATURES = "legacy-editable"
-
+    py{36,37,38,39,310}: COVERAGE_FILE = {envtmpdir}/.coverage
+    py{36,37,38,39,310}: BST_TEST_HOME = {envtmpdir}
+    py{36,37,38,39,310}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache
+    py{36,37,38,39,310}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config
+    py{36,37,38,39,310}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share
     # This is required to get coverage for Cython
-    py{37,38,39,310,311}-!nocover: BST_CYTHON_TRACE = 1
+    py{36,37,38,39,310}-!nocover: BST_CYTHON_TRACE = 1
     randomized: PYTEST_ADDOPTS="--random-order-bucket=global"
 
 whitelist_externals =
-    py{37,38,39,310,311}:
+    py{36,37,38,39,310}:
         mv
         mkdir