Skip to Content
Python 技術手冊 第三版
book

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
784
|
25 章 發布擴充功能與程式
setup.cfg 檔案
setup.cfg
為建置時期(build-time)的命令之選項提供適當的預設值。舉例
來說,你可以新增下列的文字行到
setup.cfg
,以永遠建置
universal wheels
通用的
wheels
,請參閱後面的「建立 wheels」):
[bdist_wheel]
universal=1
發布你的套件
一旦你準備好你的
setup.py
(和其他檔案),發布你的套件需要下列步驟:
1. distribution 建立(「封裝」)為一個 wheel 或其他的封存格式(archive
format)。
2. 如果必要的話,將你的套件註冊到一個存放庫(repository)。
3. 上傳你的套件到那個存放庫。
建立 Distribution
在過去,以
python setup.py sdist
製作的一個封裝好的「source(原始
)」 distribution
sdist
)是你能以
distutils
產生的最有用的檔案了。如
果你要為某個版本的 Linux 發布帶有 C 擴充功能的套件,你仍然會想要
建立一個
sdist
而當你絕對需要絕對路徑(而非相對路徑)以安裝特定檔
案(列在
setup.py
data_files
中),你就需要使用一個
sdist
。(請參閱
Python Packaging User Guide 中有關
data_files
的討論(
https://packaging.
python.org/distributing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

利用 Python 进行数据分析(原书第2版)

利用 Python 进行数据分析(原书第2版)

Wes McKinney

Publisher Resources

ISBN: 9789864766819