IGORNET wiki

... where shit is known.

Benutzer-Werkzeuge

Webseiten-Werkzeuge


ubuntu:dev-python-package

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
ubuntu:dev-python-package [2025/11/14 13:14] – [Build setup] falkubuntu:dev-python-package [2025/11/14 13:28] (aktuell) falk
Zeile 19: Zeile 19:
       name="myproject",       name="myproject",
       version="0.1.0",       version="0.1.0",
-      packages=find_packages(where="src"),  # <-- find packages in src/ +      packages=find_packages(where="src"), 
-      package_dir={"": "src"},               # <-- map packages to src/+      package_dir={"": "src"},
       entry_points={       entry_points={
           "console_scripts": [           "console_scripts": [
-              "myproject= myproject.entry:main",  # <-- entry.py must have main()+              "myproject=myproject.entry:main",
           ],           ],
       },       },
-      install_requires=[ +  )  
-          # Add dependencies here if any +
-      ], +
-  ) +
-  +
  
 **Important notes:** **Important notes:**
Zeile 37: Zeile 33:
   * package_dir={"": "src"} → tells setuptools that the root of packages is src/.   * package_dir={"": "src"} → tells setuptools that the root of packages is src/.
   * entry_points → your CLI script. It must point to a function, e.g., main() in entry.py:   * entry_points → your CLI script. It must point to a function, e.g., main() in entry.py:
 +
 +===== Build =====
 +  - Create source distribution <code>python3 setup.py sdist</code>
 +  - Convert to Debian package format <code>py2dsc dist/myproject-0.1.0.tar.gz</code>
 +  - Build the actual .deb <code>cd deb_dist/myproject-0.1.0-1
 +dpkg-buildpackage -us -uc</code>
 +
 +
ubuntu/dev-python-package.1763122481.txt.gz · Zuletzt geändert: von falk