diff --git a/tests/files/conan_1_expected.py b/tests/files/conan_1_expected.py index aa0d77f..0a1dc36 100644 --- a/tests/files/conan_1_expected.py +++ b/tests/files/conan_1_expected.py @@ -34,7 +34,7 @@ def configure(self): raise ConanInvalidConfiguration("Double Convertion could not be built by MSVC <14") def source(self): - tools.get("{0}/archive/v{1}.tar.gz".format(self.homepage, self.version)) + tools.get(f"{self.homepage}/archive/v{self.version}.tar.gz") extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) diff --git a/tests/files/conan_1_old.py b/tests/files/conan_1_old.py index fc788b1..aa0d77f 100644 --- a/tests/files/conan_1_old.py +++ b/tests/files/conan_1_old.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from conans import ConanFile, CMake, tools -from conans.model.version import Version -from conans.errors import ConanInvalidConfiguration +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.scm import Version +from conans import CMake, tools import os # Conanfiles aren't executables, don't add a hashbang @@ -15,17 +13,15 @@ class DoubleConversionConan(ConanFile): version = "3.0.0" url = "https://github.com/bincrafters/conan-double-conversion" homepage = "https://github.com/google/double-conversion" - author = "Bincrafters " description = "Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles." license = "MIT" - exports = ["LICENSE.md"] exports_sources = ["CMakeLists.txt"] generators = "cmake" settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], "fPIC": [True, False]} - default_options = "shared=False", "fPIC=True" - source_subfolder = "source_subfolder" - build_subfolder = "build_subfolder" + default_options = {'shared': False, 'fPIC': True} + _source_subfolder = "source_subfolder" + _build_subfolder = "build_subfolder" def config_options(self): if self.settings.os == "Windows": @@ -40,22 +36,22 @@ def configure(self): def source(self): tools.get("{0}/archive/v{1}.tar.gz".format(self.homepage, self.version)) extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self.source_subfolder) + os.rename(extracted_dir, self._source_subfolder) - def configure_cmake(self): + def _configure_cmake(self): cmake = CMake(self) - cmake.configure(build_folder=self.build_subfolder) + cmake.configure(build_folder=self._build_subfolder) return cmake def build(self): - cmake = self.configure_cmake() + cmake = self._configure_cmake() cmake.build() def package(self): - cmake = self.configure_cmake() + cmake = self._configure_cmake() cmake.install() - self.copy(pattern="LICENSE", dst="licenses", src=self.source_subfolder, keep_path=False) + self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder, keep_path=False) def package_info(self): self.cpp_info.libs = tools.collect_libs(self) - self.cpp_info.cppflags = ["-pthread"] + self.cpp_info.cxxflags = ["-pthread"] diff --git a/tests/files/conan_multiline_options_old.py b/tests/files/conan_multiline_options_old.py index 343937e..a532976 100644 --- a/tests/files/conan_multiline_options_old.py +++ b/tests/files/conan_multiline_options_old.py @@ -39,7 +39,7 @@ def configure(self): raise ConanInvalidConfiguration("Double Convertion could not be built by MSVC <14") def source(self): - tools.get("{0}/archive/v{1}.tar.gz".format(self.homepage, self.version)) + tools.get(f"{self.homepage}/archive/v{self.version}.tar.gz") extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self.source_subfolder)