Code Monkey home page Code Monkey logo

pyscaffold's Introduction

pyscaffold

An opinionated starter template for setting up a python 3.12+ package with a CLI.

NOTE: this project is unrelated to the excellent PyScaffold project. This repo will likely not be published to pypi, and handles a much smaller and more narrow use case. Apologies in advance for the confusion in naming.

Customize for your project...

To customize for your own package:

  1. Search & replace pyscaffold and replace with yourproject (or whatever you want to call it).
    • includes source code, tests, and this readme!
    • rename the pyscaffold project and test folder too
  2. Review pyproject.toml; change authors, classifiers, project.urls, etc.
  3. Follow the "Developer setup" section below
  4. Update this readme! Delete this section, edit quickstart guide, etc.

This is a manual cookiecutter. This was done intentionally; keeping it a manual job is nice for testing because it makes it easier to ensure that our github actions work as expected.

Quickstart

Make sure you have python 3.12 available and on your path. Then:

# update pip
python -m pip install -U pip

# if it's local file or a github link...
pip install path/to/pyscaffold-0.0.1-py3-none-any.whl
# if it's on pypi
pip install pyscaffold

# test our CLI
pyscaffold --help
pyscaffold hello
pyscaffold hello --name Andy
pyscaffold bottles --num 20

Developer setup

Make sure you have python 3.12 available and on your path. Then:

# clone project
git clone [email protected]:shapiromatron/pyscaffold.git
cd pyscaffold

# create virtual environment and activate
python -m venv venv --prompt pyscaffold
source venv/bin/activate  # or venv\Scripts\activate on windows.

# install packages
python -m pip install -U pip
python -m pip install -e ".[dev]"

# test local install
pyscaffold hello

# these should work on mac/linux/windows
make test   # run tests
make lint   # identify formatting errors
make format  # fix formatting errors when possible
make build  # build a python wheel

Github actions are setup to execute whenever code is pushed to check code formatting and successful tests. In addition, when code is pushed to the main branch, a wheel artifact is created and stored on github.

pyscaffold's People

Contributors

shapiromatron avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.