Skip to content

Commit

Permalink
Remove duplicate version option
Browse files Browse the repository at this point in the history
  • Loading branch information
dean0x7d committed Feb 21, 2024
1 parent e8b4dab commit da484bc
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
# noinspection PyUnresolvedReferences
class EmbeddedPython(ConanFile):
name = "embedded_python"
version = "1.9.0" # of the Conan package, `options.version` is the Python version
version = "1.9.0" # of the Conan package, `embedded_python-core:version` is the Python version
license = "PSFL"
description = "Embedded distribution of Python"
topics = "embedded", "python"
homepage = "https://www.python.org/"
url = "https://github.com/lumicks/embedded_python"
settings = "os", "arch"
options = {
"version": ["ANY"],
"packages": [None, "ANY"],
"pip_version": ["ANY"],
"pip_licenses_version": ["ANY"],
Expand All @@ -38,23 +37,20 @@ class EmbeddedPython(ConanFile):
def requirements(self):
self.requires(f"embedded_python-core/1.2.2@{self.user}/{self.channel}")

def configure(self):
self.options["embedded_python-core"].version = self.options.version

@property
def pyversion(self):
"""Full Python version that we want to package, e.g. 3.11.3"""
return scm.Version(self.options.version)
return scm.Version(self.dependencies["embedded_python-core"].options.version)

@property
def short_pyversion(self):
"""The first two components of the version number, e.g. 3.11"""
return scm.Version(".".join(str(self.options.version).split(".")[:2]))
return scm.Version(".".join(str(self.pyversion).split(".")[:2]))

@property
def int_pyversion(self):
"""The first two components of the version number in integer form, e.g. 311"""
return scm.Version("".join(str(self.options.version).split(".")[:2]))
return scm.Version("".join(str(self.pyversion).split(".")[:2]))

@property
def core_pkg(self):
Expand Down

0 comments on commit da484bc

Please sign in to comment.