Skip to content

gerardnico/python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Hello World Package

About

This is a starting project that demonstrate how to create a distribution package from a regular package

Project

Structure

This project use a src layout

├── src
│   └── mypackage
│       ├── __init__.py
│       └── mod1.py
├── setup.py
└── setup.cfg

that is declared in the setup.py file

packages=setuptools.find_packages(where='src'),
package_dir={'': 'src'},  # tell distutils packages are under src

Installation

  • Get this (distribution package|project) locally
  • Install Python
  • Install the setuptools
python -m pip install --upgrade pip setuptools wheel
  • Then
cd directory/of/the/project
pip install .

Console script

This will install the hello script defines in the setup.py file at the entry_points property as the function main of the module hello_cli

where hello
C:\Python37-32\Scripts\hello.exe
  • Running the script
hello nico
>>> Arguments passed in: ['nico']
>>> Flags detected: <args []>
>>> Files detected: []
>>> NOT Files detected: <args ['nico']>
>>> Grouped Arguments: {'_': <args ['nico']>}
>>> Your IP: 143.176.206.81

Dependencies

The dependencies are defined in the install_requires property of the setup.py file.

Documentation

About

Sample python project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages