Giter Site home page Giter Site logo

ubuntu-make's Introduction

Ubuntu Make

Ubuntu Make is a project designed to enable quick and easy setup of common needs for developers on Ubuntu.

Get it from the Snap Store

Current project health

Build Status (pep8 and small tests)

Snap Status

Installing

SNAP

We recommend to use the Ubuntu Make snap to ensure you always have the latest and greatest version, even on older supported releases.

$ snap install ubuntu-make --classic

If installed via the snap it can be run as ubuntu-make.umake, or via the alias umake

Ubuntu Make interacts heavily with the system, in particular with the apt database. Confined or devmode snaps aren’t able to do that.

Transitioning to a classic snap gives us the same power than a debian package on this regard, while still enabling for a smoother transition.

More information on this confined snap is available at https://didrocks.fr/2017/07/05/ubuntu-make-as-a-classic-snap-intro/

PPA

There is also a daily built ppa:

sudo add-apt-repository ppa:lyzardking/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make

Listing

Umake has three listing options:

  • --list to show all the frameworks
  • --list-available to show the available frameworks
  • --list-installed to show the installed frameworks

Running the command line tool

To run the tool:

$ ./umake

You can use --help to get more information and change the verbosity of the output with -v, -vv.

Requirements

Note that this project uses python3 and requires at least python 3.3. All commands use the python 3 version. There are directions later on explaining how to install the corresponding virtualenv.

Shell completion

To enable shell completion on bash or zsh, just run:

$ . enable_completion

Different level of logging

Multiple logging profiles are available in confs/ to be able to have different traces of your execution (particularly useful for debugging). For instance, you will find:

  • debug.logcfg: Similar to using -vv, but also puts logs in a debug.log.
  • debug_network.logcfg: The root logging level is INFO (-v), the network activities are in DEBUG mode and will be logged in debug_network.log.
  • testing.logcfg: Mostly for coverage tests, do not set any logging config on stdout, but:
  • DEBUG logs and above are available in debug.log.
  • INFO logs and above are available in info.log.
  • WARNING and ERROR logs are available in error.log.

Under normal circumstances, we expect error.log to remain empty../

To load one of those logging profiles:

$ LOG_CFG=confs/debug.logcfg bin/umake

Development

Providing user's framework

It's possible for anyone to have local frameworks for either development purposes or for special local or team use-cases.

  • Any files in a directory set with the "UMAKE_FRAMEWORKS" environment variable will be loaded first.
  • Any files inside ~/.umake/frameworks will be loaded next.

Any file should eventually contain a category or frameworks like the ones in umake/frameworks/*.

If category names are duplicated only one will be loaded. Ubuntu Make will first load the one controlled by the environment variable, then the one located in the home based directory, and finally, the system one. Note that duplicate filenames are supported but not encouraged.

Style guide and checking

We are running pep8, but the max line length has been relaxed to 120. env/ is excluded from the pep8 check as well.

Running this test, in particular:

$ ./runtests pep8

This will run those pep8 checks on the code.

You can also run the pep8 tool directly from the project directory:

$ pep8 .

Tests

Types of tests

There are four types of tests that can be combined in runtests:

  • pep8: Run the pep8 tests on all the umake and test code.
  • small: Tests modules and components with mock content around them. Note that this uses a local webserver (http and https) to serve mock content.
  • medium: Tests the whole workflow. It directly calls end user tools from the command line, but without affecting the local system. Requirements like installing packages are mocked, as well as the usage of a local webserver serving (smaller) content similar to what will be fetched in a real use case. The assets have the same formats and layout.
  • large: Runs the same tests as the medium test, but with real server downloads and installation of dpkg packages. Most of these tests need root privileges. Be aware that these tests only run on a graphical environment. It will interfere with it and it is likely to install or remove packages on your system.

To run all the tests, with coverage report, like in our jenkins infra:

$ ./runtests

Use --no-config to disable the coverage report selection.

Running some tests with all debug infos

By default, runtests will not display any debug output if the tests are successful, similar to Nose. However, if only some tests are selected, runtests will a display full debug log,

$  ./runtests tests/small/test_tools.py:TestConfigHandler

Use --no-config to disable the debug output selection.

More information on runtests

runtests is a small nose wrapper used to simplify the testing process. By default, if no arguments are supplied or if "all" is supplied, runtests will run all available tests on the project using the production nose configuration. It is possible to run only some types of tests:

$ ./runtests small medium

This will only run small and medium tests, with all nose defaults (no profile is selected).

Finally, you can run a selection of one or more tests:

$ ./runtests tests/small/test_tools.py:TestConfigHandler

This enables the debug profile by default, to display all outputs and logging information (at debug level).

You can activate/disable/change any of those default selected configurations with --config/--coverage/--debug/--no-config (see runtests --help for more information)

Nose configurations

Some nose configurations are available in confs/. You will find:

  • debug.nose: this profile shows all outputs and logging information while turning debug logging on.
  • prod.nose: this profile keeps all outputs captured, but display tests coverage results.

Check for Python warnings:

runtests is compatible with showing the Python warnings:

$ PYTHONWARNINGS=d ./runtests

Create your own environment and run from it

For an easier development workflow, we encourage the use of virtualenv to test and iterate on the project rather than installing all the requirements on your machine. In the project root directory run (env/ is already in .gitignore and excluded from pep8 checking):

$ virtualenv --python=python3 --system-site-packages env
$ sudo apt-get install -qq python3-apt # use the system version of python apt
$ sudo apt-get install -qq python3-gi # not installable with pypi
$ sudo apt-get install -qq bzr python3-dev # requires for pip install -r
$ env/bin/pip install -r requirements.txt
$ source env/bin/activate
$ bin/umake

Developing using system package

Instead of using a virtual environment, you can install system packages to be able to run the Ubuntu Make tests. The build dependencies are listed in debian/control and should be available in latest development Ubuntu version. If you are using the latest LTS, you should find them in a dedicated Ubuntu Make Build-dep ppa.

Release management

Refresh .pot files:

$ ./setup.py update_pot

ubuntu-make's People

Contributors

didrocks avatar lyzardking avatar ivuk avatar ojsheikh avatar tinche avatar jravetch avatar syndbg avatar aleks-sidorenko avatar sschuberth avatar tschf avatar fcole90 avatar redmcg avatar eldarkg avatar iceboundrock avatar whitesymmetry avatar pellcorp avatar neopi21 avatar wilsenhc avatar adalinesimonian avatar hmvs avatar titobrasolin avatar miamibc avatar zhouyue67 avatar mtrolley avatar harlemsquirrel avatar zgoda avatar hgarfer avatar hdevalke avatar eveninglily avatar evandandrea 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.