Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 2.49 KB

File metadata and controls

52 lines (37 loc) · 2.49 KB

In order to get this project done, I had to learn and rediscover some key concepts

  1. What is the difference between a Python library, package, and module?
  • Library: A collection of code designed to solve a particular problem or perform a specific set of activities. A library is typically composed of one or more packages.
  • Package: A namespace that organizes one or more related modules to solve a specific problem. A package is essentially a directory containing an __init__.py file and one or more module files.
  • Module: A single file that contains reusable Python code, such as functions or classes, which can be imported and used in other programs. May have multiple functions.
  1. What is the anathomy of Python packages and pyproject.toml
project
|__ pyproject.toml
    |__ package1
        |__ __init__.py
        |__ module.py

Packages needed to understand

  • setuptools: make the dist files
  • wheel: make the dist files
  • build: build the ditribute binary files (.whl and .tz)
  • twine: publish to Pypi global repository

I had to replace the construction of the library using setup.py file to pyproject.toml and learn how to use the __init__.py file to index the imports of the packages.

Use the test environment in Pypi to publish my first package (if I make a mistake there is no problem in this environment)

️ Some tips before publish the package

  1. Make sure your package code is clean and maintainable.
  2. Extend the documentation in order to make the package easier to use.
  3. Choose an appropiate software licence before publish the package.
  4. Make managing package updates easy.

To create the project we have to follow this steps

  1. Setup the pyproject.toml with the needed configuration to publish in Pypi. For setting up the project we can follow the instruction in this oficial website python setting up pyproject.

We shall choose a build back end to make the build

  • We shall choose a build back end to make the build. The most common options are hatchling or setuptools, for this case we use the setuptools option