You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

使用Poetry结合Briefcase跨平台分发Python包时setup.py options参数解析及'linux'命令报错解决问询

Error: invalid command 'linux' when combining Poetry with Briefcase for cross-platform Python app distribution

I'm trying to distribute my Python package across operating systems using Briefcase (following the official BeeWare tutorial), but I'm more familiar with using Poetry for package management. I found a tutorial that combines the two tools, but when executing the final command poetry run python setup.py linux -s, I get the error: error: invalid command 'linux'.

Here's the code for the setup() function in my setup.py:

setup(
    name=<my-details>, # Personal details omitted here
    version=version,
    description=<my-details>,
    long_description=long_description,
    author=<my-details>,
    author_email=<my-details>,
    license='BSD license',
    packages=find_packages(
        exclude=[
            'docs',
            'tests',
            'windows',
            'macOS',
            'linux',
            'iOS',
            'android',
            'django'
        ]
    ),
    classifiers=[
        'Development Status :: 1 - Planning',
        'License :: OSI Approved :: BSD license',
    ],
    install_requires=[
    ],
    options={
        'app': {
            'formal_name': <my-details>,
            'bundle': 'com.example'
        },
        # Desktop/laptop deployments
        'macos': {
            'app_requires': [
                'toga-cocoa==0.3.0.dev15',
            ]
        },
        'linux': {
            'app_requires': [
                'toga-gtk==0.3.0.dev15',
            ]
        },
        'windows': {
            'app_requires': [
                'toga-winforms==0.3.0.dev15',
            ]
        },
        # Mobile deployments
        'ios': {
            'app_requires': [
                'toga-ios==0.3.0.dev15',
            ]
        },
        'android': {
            'app_requires': [
                'toga-android==0.3.0.dev15',
            ]
        },
        # Web deployments
        'django': {
            'app_requires': [
                'toga-django==0.3.0.dev15',
            ]
        },
    }
)

I've looked up the purpose of the options parameter, but only found this brief description: "A dictionary providing the default options for the setup script." According to the tutorial, running that command should open a blank window (which works when I use Briefcase directly following the BeeWare tutorial). Since I prefer using Poetry as my primary package manager, I want to understand:

  1. The working mechanism and specific role of the options parameter
  2. How to properly configure this parameter to fix the current error, make the command work as expected, and open the blank window

内容的提问来源于stack exchange,提问作者Ren

火山引擎 最新活动