Skip to content

Commit

Permalink
Merge branch 'apache:trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
H3199 committed Sep 1, 2023
2 parents 1f6603b + abba8c1 commit d6f7893
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
- name: Run Python Checks
run: |
tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint
tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint,mypy
build_test_docker_image:
name: Build and Verify Docker Image
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build
MANIFEST
/.ropeproject/config.py
/.coverage
/.coverage*
coverage_html_report/
coverage.xml
.idea
Expand Down
15 changes: 9 additions & 6 deletions contrib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

# Docker image used for running tests the under all the supported Python
# versions
FROM ubuntu:20.04
FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

RUN set -e && \
apt-get update && \
Expand All @@ -32,18 +34,19 @@ RUN set -e && \
python3.9 \
python3.10 \
python3.11 \
python-dev \
python3-dev \
python3.7-dev \
python3.8-dev \
python3.9-dev \
python3.10-dev \
python3.11-dev \
python3.6-distutils \
python3.7-distutils \
python3.8-distutils \
python3.9-distutils \
pypy3 \
pypy3-dev \
python3-pip \
python3-distutils \
libvirt-dev \
# Needed by libvirt driver
pkg-config \
Expand All @@ -53,13 +56,13 @@ RUN set -e && \
# Workaround for zipp import error issue - https://github.com/pypa/virtualenv/issues/1630
RUN python3.8 -m pip install --upgrade pip

RUN set -e && \
python3.8 -m pip install --no-cache-dir "tox==4.4.2"

COPY . /libcloud

RUN if [ ! -f "/libcloud/README.rst" ]; then echo "libcloud/README.rst file not found, you are likely not running docker build from the repository root directory"; exit 1; fi

WORKDIR /libcloud

RUN set -e && \
python3.8 -m pip install --no-cache-dir -r requirements-ci.txt

CMD ["tox", "-e", "lint,isort-check,black-check,bandit,py3.7,py3.8,py3.9,py3.10,py3.11,pypypy3.8"]
2 changes: 2 additions & 0 deletions dist/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ echo "Uploading packages"
# shellcheck disable=SC2086
ls ./*$VERSION*.tar.gz ./*$VERSION*.whl ./*$VERSION*.tar.gz.asc
# shellcheck disable=SC2086
twine check ./*$VERSION*.tar.gz ./*$VERSION*.whl
# shellcheck disable=SC2086
twine upload ./*$VERSION*.tar.gz ./*$VERSION*.whl ./*$VERSION*.tar.gz.asc

popd
7 changes: 7 additions & 0 deletions doap_libcloud.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,13 @@
<revision>v3.7.0</revision>
</Version>
</release>
<release>
<Version>
<name>3.8.0</name>
<created>2023-08-10</created>
<revision>v3.8.0</revision>
</Version>
</release>

<repository>
<SVNRepository>
Expand Down
14 changes: 12 additions & 2 deletions docs/committer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,19 @@ key.
7. Publishing package to PyPi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We have a script that runs uploads the signed Python source files to PyPi. It
We have a script that uploads the signed Python source files to PyPi. It
uses twine, so ensure you have twine available in your path `which twine`
before running. Twine can be downloaded from https://pypi.python.org/pypi/twine
before running. Twine can be downloaded from https://pypi.python.org/pypi/twine.

You should also ensure you have 2FA / MFA enabled for your PyPi account and
generate a new API token with apache-libcloud project scope which gives
publish permission.

For more information on how to generate an API tokens and configure twine to
use this token, see:

* https://pypi.org/help/#apitoken
* https://kynan.github.io/blog/2020/05/23/how-to-upload-your-package-to-the-python-package-index-pypi-test-server

.. sourcecode:: bash

Expand Down
5 changes: 5 additions & 0 deletions integration/storage/test_azure_blobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ def setUpClass(cls):
delete_threshold_ts = now_ts - int(datetime.timedelta(hours=6).total_seconds())

for resource_group in resource_groups:
# NOTE (Tomaz): It looks like that for some reason .tags property is sometimes None
# We simply skip those. Could be resources created outside the tests
if not resource_group.tags:
continue

resource_create_ts = int(resource_group.tags.get("create_ts", now_ts))

if (
Expand Down
2 changes: 1 addition & 1 deletion libcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

__all__ = ["__version__", "enable_debug"]

__version__ = "3.8.0"
__version__ = "3.8.1.dev"


def enable_debug(fo):
Expand Down
12 changes: 6 additions & 6 deletions libcloud/test/dns/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ def test_export_zone_to_bind_format_success(self):
lines1 = result.split("\n")
lines2 = content.split("\n")

date_str = "{}-{}-{} {}:{}:{}".format(
date_str = r"{}-{}-{} {}:{}:{}".format(
now.year,
zero_pad(now.month),
zero_pad(now.day),
zero_pad(now.hour),
zero_pad(now.minute),
zero_pad(now.second),
r"\d+",
r"\d+",
)
expected_header = "; Generated by Libcloud v{} on {} UTC".format(
expected_header = r"; Generated by Libcloud v{} on {} UTC".format(
__version__,
date_str,
)

self.assertEqual(lines1[0], expected_header)
self.assertEqual(lines2[0], expected_header)
self.assertRegex(lines1[0], expected_header)
self.assertRegex(lines2[0], expected_header)

for lines in [lines1, lines2]:
self.assertEqual(len(lines), 2 + 1 + 9)
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,21 @@ module = [
ignore_errors = true

[tool.coverage.run]
parallel = false
branch = true
source = ["libcloud"]

[tool.coverage.paths]
source = [
"libcloud/",
]
tests = [
"libcloud/test/",
]

[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
Expand All @@ -210,6 +221,10 @@ exclude_lines = [
"import",
"deprecated_warning",
"in_development_warning",
"@abc.abstractmethod",
# Type checking related code,
"^if (False|TYPE_CHECKING):",
"if typing.TYPE_CHECKING",
]
ignore_errors = true

Expand Down
2 changes: 1 addition & 1 deletion requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tox==4.4.2
tox==4.8.0
2 changes: 1 addition & 1 deletion requirements-mypy.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
typing
# Mypy requires typed-ast, which is broken on PyPy 3.7 (could work in PyPy 3.8).
mypy==1.4.1; implementation_name == "cpython"
mypy==1.5.1; implementation_name == "cpython"
types-simplejson
types-certifi
types-requests
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ passenv =
CI
GITHUB_*
DOCKER_*
FORCE_COLOR
NO_COLOR
deps =
-r{toxinidir}/requirements-tests.txt
allowlist_externals =
Expand Down

0 comments on commit d6f7893

Please sign in to comment.