Skip to content

Commit

Permalink
Merge pull request #38 from home-assistant/dev
Browse files Browse the repository at this point in the history
Release 1.3
  • Loading branch information
pvizeli authored Aug 30, 2019
2 parents 8f9b0f7 + fb615db commit 4a270ff
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 86 deletions.
55 changes: 0 additions & 55 deletions .azure/azp-template-wheels.yml

This file was deleted.

57 changes: 28 additions & 29 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ variables:
- name: versionBuilder
value: '4.4'
- group: docker
- group: wheels
resources:
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'

jobs:

Expand Down Expand Up @@ -64,38 +69,32 @@ jobs:
displayName: 'Run Black'


- template: .azure/azp-template-wheels.yml
- template: templates/azp-job-wheels.yaml@azure
parameters:
name: '37_Alpine39'
python: '3.7-alpine3.9'


- template: .azure/azp-template-wheels.yml
jobName: 'Wheels_Alpine39'
builderVersion: 'dev-3.7-alpine3.9'
builderApk: 'build-base;libffi-dev;openssl-dev'
wheelsRequirement: 'requirements_all.txt'
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: 'Prepare requirements'
- template: templates/azp-job-wheels.yaml@azure
parameters:
name: '37_Alpine310'
python: '3.7-alpine3.10'

jobName: 'Wheels_Alpine310'
builderVersion: 'dev-3.7-alpine3.10'
builderApk: 'build-base;libffi-dev;openssl-dev'
wheelsRequirement: 'requirements_all.txt'
preBuild:
- script: |
cat requirements.txt requirements_build.txt > requirements_all.txt
displayName: 'Prepare requirements'
- job: 'VersionValidate'
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), eq(variables['Build.SourceBranchName'], 'dev'))
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: '3.7'
- script: |
setup_version="$(python setup.py -V)"
branch_version="$(Build.SourceBranchName)"
if [ "${branch_version}" == "dev" ]; then
exit 0
elif [ "${setup_version}" != "${branch_version}" ]; then
echo "Version of tag ${branch_version} don't match with ${setup_version}!"
exit 1
fi
displayName: 'Check version of branch/tag'
- template: templates/azp-job-version.yaml@azure
parameters:
ignoreDev: true


- job: 'Release'
Expand Down
6 changes: 6 additions & 0 deletions builder/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
build_wheels_package,
build_wheels_requirement,
extract_packages,
install_pips,
write_requirement,
)
from builder.upload import run_upload
Expand All @@ -24,6 +25,7 @@

@click.command("builder")
@click.option("--apk", default="build-base", help="APKs they are needed to build this.")
@click.option("--pip", default="Cython", help="PiPy modules needed to build this.")
@click.option("--index", required=True, help="Index URL of remote wheels repository.")
@click.option(
"--requirement",
Expand Down Expand Up @@ -55,6 +57,7 @@
)
def builder(
apk: str,
pip: str,
index: str,
requirement: Optional[Path],
requirement_diff: Optional[Path],
Expand All @@ -75,6 +78,9 @@ def builder(
wheels_dir = create_wheels_folder(output)
wheels_index = create_wheels_index(index)

# Setup build helper
install_pips(wheels_index, pip)

if local:
# Build wheels in a local folder/src
build_wheels_local(wheels_index, wheels_dir)
Expand Down
15 changes: 15 additions & 0 deletions builder/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,18 @@ def extract_packages(
def write_requirement(requirement: Path, packages: List[str]) -> None:
"""Write packages list to a requirement file."""
requirement.write_text("\n".join(packages))


def install_pips(index: str, pips: str) -> None:
"""Install all pipy string formated as 'package1;package2'."""
packages = " ".join(pips.split(";"))

result = subprocess.run(
f"pip install --upgrade --no-cache-dir --prefer-binary --find-links {index} {packages}",
shell=True,
stdout=sys.stdout,
stderr=sys.stderr,
)

# Check result of program
result.check_returncode()
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
click==7.0
click-pathlib==2019.6.13.1
requests==2.22.0
Cython==0.29.13
wheel==0.33.6
2 changes: 2 additions & 0 deletions requirements_build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cython==0.29.13
numpy==1.17.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 = "1.2"
VERSION = "1.3"

setup(
name="builder",
Expand Down

0 comments on commit 4a270ff

Please sign in to comment.