小编med*_*y56的帖子

如何在由 Poetry 构建的 Wheel 中包含共享对象文件

我有一个简单的包,其中包含 C 扩展。我正在使用 Poetry 管理我的依赖关系和构建过程。

当我运行时poetry build,扩展被编译并包含在 .tar.gz 存档中,但不在 .whl 中,我不明白为什么。从 tar.gz 归档文件安装的 pip 按预期工作,但由于 Wheel 缺少 .so,pip 安装 Wheel 会导致软件包无法使用。

我已经从这里提升了构建机制:https ://github.com/python-poetry/poetry/issues/2740

pyproject.toml

[tool.poetry]
name = "python_ctypes"
version = "0.1.0"
description = ""
authors = ["Me"]
include = [
    {path = "_extensions/*.so", format = "wheel"}
]

[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.22.1"

[tool.poetry.dev-dependencies]

[tool.poetry.build]
generate-setup-file = false
script = "build.py"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Run Code Online (Sandbox Code Playgroud)

build.py

"""Poetry build script for python_ctypes"""
import os …
Run Code Online (Sandbox Code Playgroud)

python python-wheel python-poetry

9
推荐指数
0
解决办法
3957
查看次数

使用Docker Pipeline插件时,在Jenkins中停止和删除docker容器的正确方法是什么?

我有一个Jenkins管道,它构建和运行Docker机器,而不是作为代理,但使用脚本块以及Docker Pipeline Plugin方法docker.build()Image.run().这工作正常,但如果构建失败,docker容器将继续运行!我目前Container.stop()在一个post{ always{} }街区,但它似乎没有工作.我不希望ssh进入我的Jenkins服务器以在每次构建后删除容器,我不能保留它,因为它具有特定和必要的名称.无论构建失败,我如何停止和移动容器?

我的管道:

pipeline {
    agent none
    stages {
        stage('Checkout') {
            agent any
            steps {
                checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '<some credentials>', url: '<a git repo>']]])
            }
        }
        stage('Spin Up Receiver') {
            agent any
            steps {
                script { 
                    def receiver = docker.build("receiver",  "--rm centos7_receiver")
                    def receiver_container = receiver.run("-d -v ${PWD}/realtime_files/station_name/201707/f/20170710_191:/DSK1/SSN/LOG0_f/17001 --network='rsync_test' --name='test_receiver'")
                }
            }
        }
        stage('Run Tests') {
            agent { …
Run Code Online (Sandbox Code Playgroud)

jenkins-plugins docker jenkins-pipeline

6
推荐指数
1
解决办法
5214
查看次数

cdk 引导必须由具有管理员访问权限的用户完成吗?

我正在设置一个 CDK 应用程序,以便可以将其部署到多个 AWS 账户(开发和生产)。该产品帐户是在几周前由另一位开发人员启动的,但通过使用在带有附加策略的CDKDeployUser组中调用的用户来按预期工作。使用的策略(适用于产品帐户中与 CDK 相关的所有日常功能)是:CDKDeployUsersCDKDeployPolicy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "sts:AssumeRole"
            ],
            "Resource": [
                "arn:aws:iam::*:role/cdk-*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "cloudformation:*"
            ],
            "Resource": [
                "arn:aws:cloudformation:us-west-2:*:*"
            ]
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

当我设置开发帐户时,我创建了一个完全相同的用户、组、策略并尝试运行,cdk bootstrap但出现了关于能够承担cdk-*新创建的帐户中尚不存在的相关角色的错误。我假设 Cloudformation 会像在产品帐户中一样创建这些角色,但同样,我也不确切知道该帐户是如何引导的。

为了“让它工作”,我向CDKDeployUsers组添加了管理员策略并运行cdk bootstrap,当然引导程序确实创建以前无法使用的必要角色。

那么,引导必须由管理员完成,即使后续 CDK 操作可以用少得多的权限执行,这是众所周知的事情吗?

我在任何地方都找不到它的记录。期望我们每次需要引导时都添加管理策略(或从 CDK v2 升级引导模板),然后再分离它们,这似乎很疯狂。

amazon-web-services amazon-iam aws-cdk

6
推荐指数
1
解决办法
1507
查看次数

How to use RxJS in Angular2 to interact with HATEOAS API?

I have a (Django) API that implements HATEOAS, so typically foreign keyed objects come through as URLs to other API endpoints. The following is the result from http://localhost:8000/brew-monitor/api/fermentations/1/ and is a Fermentation object with associated Dataset objects:

{
    "id": 1,
    "name": "My Beer",
    "datasets": [
        "http://localhost:8000/brew-monitor/api/datasets/1/",
        "http://localhost:8000/brew-monitor/api/datasets/2/"
    ]
}
Run Code Online (Sandbox Code Playgroud)

I need to write a service that will GET the above object and then iterate through the datasets URLs and GET those as well (I know, maybe it can be more …

hateoas rxjs angular2-services

0
推荐指数
1
解决办法
90
查看次数