Coder Social home page Coder Social logo

autopypa's Introduction

Description

Python semi-automatic package building script

How to

A minimal setup.py

setup(
    name='MyPackageName',
    version='1.0.0',
    description='Description of my package',

    py_modules=["mymodule"] # Single modules project,
    package_dir={"":"src"} # Telling setuptools our code is in ./src directory
)

Cloning project from a repo

  1. Edit the ./templates/setup.py with your data and Add your LICENSE if you want to:

  2. Run the script like ./build my_remote_git_repo

    • It will clone it and create your package at ./cloned_package/dist/

Now your project is ready to be deployed or used anywhere else you need to :)

Useful files - For more accurate behaviour

templates
    MANIFEST.in
    setup.py
    README.md
    ...
  1. [OPTIONAL] Edit the MANIFEST.in with the includes,excludes you need.
  • If you happen to use MANIFEST.in you better add it in the line 56 from the build script to enable the copy of this file for packaging.

Example of MANIFEST.in

include src/my_package/main.py
include src/my_package/requirements.txt
recursive-include src/my_package/libs *
recursive-exclude src/my_package/tests *
recursive-exclude .DS_Store *
  1. [OPTIONAL] pyproject.toml for telling which backend build system we're using.

Future updates - TODOs

  • Creatre a windows-like script (or make it different)
  • Make the process of setup.py automatic (cli for example)
  • Automatic fetching a LICENSE or creating it
    • Download/scrape from opensource.org
    • Have some templates and make the subtitution using a cli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.