Skip to content

Commit

Permalink
Merge pull request #30 from home-assistant/dev
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
pvizeli authored Jul 11, 2019
2 parents a3a2aff + a92165f commit 4bceebd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ COPY requirements.txt /usr/src/
RUN apk add --no-cache \
rsync \
openssh-client \
&& apk add --no-cache --virtual .build-dependencies \
build-base \
&& pip3 install --no-cache-dir --find-links "https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \
&& pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links \
"https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \
-r /usr/src/requirements.txt \
&& rm -f /usr/src/requirements.txt \
&& apk del .build-dependencies
&& rm -f /usr/src/requirements.txt

# Install builder
COPY . /usr/src/builder/
Expand Down
3 changes: 2 additions & 1 deletion builder/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
extract_packages,
)
from builder.upload import run_upload
from builder.utils import check_url
from builder.utils import check_url, fix_wheels_name


@click.command("builder")
Expand Down Expand Up @@ -84,6 +84,7 @@ def builder(apk, index, requirement, upload, remote, requirement_diff, single, l
except CalledProcessError:
exit_code = 109

fix_wheels_name(wheels_dir)
run_upload(upload, output, remote)

sys.exit(exit_code)
Expand Down
12 changes: 12 additions & 0 deletions builder/utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""Some utils for builder."""
from pathlib import Path
import os
import re

import requests

RE_WHEEL_PLATFORM = re.compile(r"^(?P<name>.*-)cp\d{2}m-linux_\w+\.whl$")


def alpine_version() -> str:
"""Return alpine version for index server."""
Expand All @@ -21,3 +24,12 @@ def check_url(url: str) -> None:
"""Check if url is responsible."""
response = requests.get(url, timeout=10)
response.raise_for_status()


def fix_wheels_name(wheels_folder: Path) -> None:
"""Remove platform tag from filename."""
for package in wheels_folder.glob("*.whl"):
match = RE_WHEEL_PLATFORM.match(package.name)
if not match:
continue
package.rename(Path(package.parent, f"{match.group('name')}none-any.whl"))
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
click==7.0
click-pathlib==2019.6.13.1
requests==2.22.0
Cython==0.29.10
Cython==0.29.12
wheel==0.33.4
2 changes: 1 addition & 1 deletion requirements_tests.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flake8==3.7.7
flake8==3.7.8
pylint==2.3.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

VERSION = "0.11"
VERSION = "1.0"

setup(
name="builder",
Expand Down

0 comments on commit 4bceebd

Please sign in to comment.