GithubHelp home page GithubHelp logo

zongjing-han / u7627363 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gavinhuttley/demoproject

0.0 0.0 0.0 18 KB

Initial project using click

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

u7627363's Introduction

Overview

This repository contains code for a software development project that includes a command-line interface with a project structure that follows best practice for Python projects. The config file (pyproject.toml) shows the minimal information necessary to define a command-line tool where the build is controlled using flit. It also includes example configuration for dependencies, code-style tools (black, isort) and setting pytest options.

Edit pyproject.toml file to fit your project.

If you want the command-line interface, edit section project.scripts (line 31). (If you don't want it, just delete that section.)

The src/myproject/cli.py presents an example of a command line application that uses SciTrack for logging, and click for specifying the interface.

Once you have edited this toml (making sure you've added it and any others you need into your project repository), you can do a "developer" install as

$ flit install -s --python `which python`

When it's correctly installed, you can run the following

$ myproject demo-echo "blah blah"
blah blah

where the output will be blue.

Testing

I've included a test file that uses the click test runner. I have also included a noxfile.py

In the top-level directory, the following commands will run the tests

$ pytest

or

$ nox -s test-3.10

which will also generate a xml formatted coverage report. This is useful within a GitHub action for upload to codecov.

Test coverage

I have also included a nox subcommand for producing a code coverage report.

$ nox -s testcov

Which will produce a coverage report in html format in the top level directory.

Hack away ๐Ÿค” and enjoy ๐ŸŽ‰!

u7627363's People

Contributors

gavinhuttley avatar zongjing-han 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.