1

を必要とするパッケージに取り組んでいますsh。このパッケージは、Windows ではサポートされていません。shWindows の場合、からフォークされた古いパッケージを使用し、自分の名前空間で名前pbsを変更します。sh

Windows やその他のプラットフォームにsetup.py正しくインストールされるを作成するにはどうすればよいですか?pbssh

編集:いくつかの調査の結果、私の答えが反映されているように、私の質問は新しいホイール形式に固有のものであることがわかりました。ホイールがどのように機能するのか分からない場合は、将来別の質問をします。

4

2 に答える 2

3

はい!次のように、コードを sys.platform 変数の条件付きブロックに入れるだけです。

import sys
if (sys.platform=='win32'):
    import somewindowsmodule
elif (sys.platform=='macOSX'):
    import somemacmodule
elif (sys.platform=='linux'):
    import somelinuxmodule

Mac または Linux のプラットフォーム文字列が何であるかはわかりませんが、それを理解できるはずです。また、罪のない人を保護するために、一部のモジュール名はすべて架空のものです。:)

于 2014-01-27T01:19:59.577 に答える
2

Ok, it turns out my original solution was correct:

# setup.py
...
setup(
...

    install_requires=["pbs" if os.name == 'nt' else "sh"]
...
)

The reason this recently broke was due to releasing in the new wheel format. My understanding is that this new format does not ship a setup.py with your package and handles dependencies using some other means.

Until I understand how to ship a wheel with conditional dependencies, I just won't produce wheels for this project.

于 2014-01-27T01:27:51.173 に答える