Skip to content
Snippets Groups Projects
Commit 8fa9a42c authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[build] Rename osname() to conda_arch(); Reflect these changes; Fix git clean cmd

parent fa9beb74
No related branches found
No related tags found
No related merge requests found
Pipeline #26043 passed
...@@ -26,8 +26,8 @@ import distutils.version ...@@ -26,8 +26,8 @@ import distutils.version
import conda_build.api import conda_build.api
def osname(): def conda_arch():
"""Returns the current OS name as recognized by conda""" """Returns the current OS name and architecture as recognized by conda"""
r = 'unknown' r = 'unknown'
if platform.system().lower() == 'linux': if platform.system().lower() == 'linux':
...@@ -329,8 +329,9 @@ if __name__ == '__main__': ...@@ -329,8 +329,9 @@ if __name__ == '__main__':
verbose=True) verbose=True)
# runs the build using the conda-build API # runs the build using the conda-build API
arch = conda_arch()
logger.info('Building %s-%s-py%s (build: %d) for %s', logger.info('Building %s-%s-py%s (build: %d) for %s',
name, version, pyver.replace('.',''), build_number, osname()) name, version, pyver.replace('.',''), build_number, arch)
conda_build.api.build(os.path.join(workdir, 'conda'), config=conda_config) conda_build.api.build(os.path.join(workdir, 'conda'), config=conda_config)
# runs git clean to clean everything that is not needed. This helps to keep # runs git clean to clean everything that is not needed. This helps to keep
...@@ -339,7 +340,7 @@ if __name__ == '__main__': ...@@ -339,7 +340,7 @@ if __name__ == '__main__':
"miniconda.sh", #the installer, cached "miniconda.sh", #the installer, cached
"miniconda/pkgs/*.tar.bz2", #downloaded packages, cached "miniconda/pkgs/*.tar.bz2", #downloaded packages, cached
"miniconda/pkgs/urls.txt", #download index, cached "miniconda/pkgs/urls.txt", #download index, cached
"miniconda/conda-bld/${_os}-64/*.tar.bz2", #build artifact -- conda "miniconda/conda-bld/%s/*.tar.bz2" % (arch,), #build artifact -- conda
"dist/*.zip", #build artifact -- pypi package "dist/*.zip", #build artifact -- pypi package
"sphinx", #build artifact -- documentation "sphinx", #build artifact -- documentation
] ]
......
...@@ -12,7 +12,7 @@ import yaml ...@@ -12,7 +12,7 @@ import yaml
from . import bdt from . import bdt
from ..log import verbosity_option from ..log import verbosity_option
from ..build import next_build_number, osname, should_skip_build, \ from ..build import next_build_number, conda_arch, should_skip_build, \
get_rendered_metadata, get_parsed_recipe, make_conda_config get_rendered_metadata, get_parsed_recipe, make_conda_config
from ..constants import CONDA_BUILD_CONFIG, CONDA_RECIPE_APPEND, \ from ..constants import CONDA_BUILD_CONFIG, CONDA_RECIPE_APPEND, \
SERVER, MATPLOTLIB_RCDIR, BASE_CONDARC SERVER, MATPLOTLIB_RCDIR, BASE_CONDARC
...@@ -125,9 +125,10 @@ def build(recipe_dir, python, condarc, config, no_test, append_file, ...@@ -125,9 +125,10 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
metadata = get_rendered_metadata(d, conda_config) metadata = get_rendered_metadata(d, conda_config)
# checks we should actually build this recipe # checks we should actually build this recipe
arch = conda_arch()
if should_skip_build(metadata): if should_skip_build(metadata):
logger.warn('Skipping UNSUPPORTED build of "%s" for py%s on %s', logger.warn('Skipping UNSUPPORTED build of "%s" for py%s on %s',
d, python.replace('.',''), osname()) d, python.replace('.',''), arch)
return 0 return 0
# converts the metadata output into parsed yaml and continues the process # converts the metadata output into parsed yaml and continues the process
...@@ -143,7 +144,7 @@ def build(recipe_dir, python, condarc, config, no_test, append_file, ...@@ -143,7 +144,7 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
logger.info('Building %s-%s-py%s (build: %d) for %s', logger.info('Building %s-%s-py%s (build: %d) for %s',
rendered_recipe['package']['name'], rendered_recipe['package']['name'],
rendered_recipe['package']['version'], python.replace('.',''), rendered_recipe['package']['version'], python.replace('.',''),
build_number, osname()) build_number, arch)
if not dry_run: if not dry_run:
from conda_build.api import build from conda_build.api import build
build(d, config=conda_config, notest=no_test) build(d, config=conda_config, notest=no_test)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment