Sto provando a generare pacchetti di distribuzione binaria specifici per piattaforma per Windows, ma python setup.py bdist_wheel
genera nomi di file universali. Cosa devo cambiare nel mio setup.py o in altro modo per ottenere ruote con nomi specifici della piattaforma? Da quanto ho capito, setuptools dovrebbe riconoscere quando un pacchetto non sarà universale, ma questo non funziona per me.I nomi delle ruote sono indipendenti dalla piattaforma anche se il mio pacchetto include librerie compilate
Il progetto su cui sto lavorando compila diverse varianti di librerie utilizzando cmake e mingw w64. Queste librerie compilate sono ovviamente specifiche per 32/64 bit. Per creare le singole distribuzioni creo un virtualenv per la piattaforma di destinazione da cui compilo le librerie. Le librerie compilate vengono quindi copiate nel pacchetto python per essere ruotate.
Ecco il mio setup.py. pyfvs_files è una lista di file compilati '* .pyd' da includere. Questo produce ruote chiamate 'pyfvs-0.0.1a0-py27-none-any.whl' dove mi aspetterei che siano 'pyfvs-0.0.1a0-py27-none-win32.whl' e 'pyfvs-0.0.1a0-py27 -Non-win_amd64.whl'. Se installati tramite pip, i pacchetti funzionano come previsto per la piattaforma di destinazione, ma naturalmente falliscono per la piattaforma alternativa. In definitiva mi piacerebbe supportare Python 2.7, 3.4, 3.5 su entrambe le finestre 32 & 64 bit e Linux 64 bit.
import os
from glob import glob
from setuptools import setup
from setuptools.dist import Distribution
# TODO: Get the version from the git tag and or revision.
version = '0.0.1a0'
if os.name=='nt':
so_ext = 'pyd'
else:
so_ext = 'so'
pyfvs_files = glob('pyfvs/*.{}'.format(so_ext))
pyfvs_files.extend(['pyfvs/pyfvs.cfg',])
description = open('./README.txt').readline().strip()
long_desc = open('./README.txt').read().strip()
class BinaryDistribution(Distribution):
def is_pure(self):
return False
setup(
name='pyfvs'
, version=version
, description=description
, long_description=long_desc
, url=''
, author=""
, author_email=""
, packages=['pyfvs',]
, include_package_data=True
, distclass=BinaryDistribution
, data_files = [
('pyfvs',pyfvs_files)
, ('pyfvs/docs',glob('pyfvs/docs/*'))
, ('pyfvs/examples',glob('pyfvs/examples/*'))
, ('pyfvs/test',glob('pyfvs/test/*'))
]
, entry_points={
'console_scripts': [
'fvs=pyfvs.__main__:main'
]
}
, classifiers=[
'Development Status :: 3 - Alpha'
, 'Environment :: Console'
, 'Intended Audience :: Developers'
, 'Intended Audience :: End Users/Desktop'
, 'Intended Audience :: Science/Research'
, 'Natural Language :: English'
, 'Programming Language :: Python'
, 'Programming Language :: Fortran'
]
, keywords=''
)