Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-packaging 24.0 #23091

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipes/python_packaging/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"24.0":
url: "https://github.com/pypa/packaging/archive/refs/tags/24.0.tar.gz"
sha256: "1bf35cf2c2be982f2ae6c905760ae19cb744fadbf56269f2e54f7bdcef64d291"
45 changes: 45 additions & 0 deletions recipes/python_packaging/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from conan import ConanFile
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
import os


required_conan_version = ">=1.47.0"


class PackageConan(ConanFile):
name = "python_packaging"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have consistence naming. #23098 used a hypen instead of underscore.
Personally, I would prefer a hypen. It is also closer to how we handle double package names.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used a hyphen to stay as close as possible to how Linux distributions manage Python packages, fyi.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "python_packaging"
name = "python-packaging"

description = "Core utilities for Python packages"
license = ("BSD-2-Clause", "Apache-2.0")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/pypa/packaging/"
topics = ("python")
package_type = "build-scripts"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

def layout(self):
basic_layout(self, src_folder="src")

def package_id(self):
self.info.clear()

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def build(self):
pass

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*", os.path.join(self.source_folder, "src"), os.path.join(self.package_folder, "lib", "python3", "dist-packages"))

def package_info(self):
self.cpp_info.frameworkdirs = []
self.cpp_info.libdirs = []
self.cpp_info.resdirs = []
self.cpp_info.includedirs = []

opengv_dist_packages = os.path.join(self.package_folder, "lib", "python3", "dist-packages")
self.runenv_info.prepend_path("PYTHONPATH", opengv_dist_packages)
self.env_info.PYTHONPATH.append(opengv_dist_packages) # remove in conan v2?
13 changes: 13 additions & 0 deletions recipes/python_packaging/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from conan import ConanFile


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "VirtualBuildEnv"
test_type = "explicit"

def build_requirements(self):
self.tool_requires(self.tested_reference_str)

def test(self):
self.run("python -c \"import packaging.version\"")
3 changes: 3 additions & 0 deletions recipes/python_packaging/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"24.0":
folder: all
Loading