summaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)Author
2021-09-01Fix `make style-check` errors (#1000)Shreenidhi Shedi
Using flake8 inplace of pyflakes Renamed run-pyflakes -> run-flake8 Changed target name to flake8 in Makefile With pyflakes we can't suppress warnings/errors in few required places. flake8 is flexible in that regard. Hence using flake8 seems to be a better choice here. flake8 does the job of pep8 anyway. So, removed pep8 target from Makefile along with tools/run-pep8 script. Included setup.py in flake8 checks
2020-05-01Adapt the package building scripts to use Python 3 (#231)Paride Legovini
Since upstream cloud-init has dropped python2 support, adapt remaining package build scripts and tools to python3 only Changes: * Do not template debian/rules as python3 is the only supported version * Drop six from requirements.txt * Makefile: drop everything related to Python 2 * run-container: install the CI deps only on ubuntu|debian * read-version: update the shebang to use Python 3 * brpm: read_dependencies(): drop unused argument * read-dependencies: switch to Py3 and drop the --python-version option * pkg-deps.json: drop the Python version field and update the redhat deps * pkg-deps.json: drop the unittest2 and contextlib2 renames * Update RPM the spec file to use Python 3 when building the RPM * bddeb: drop support for Python 2
2020-03-10cloudinit: move to pytest for running tests (#211)Daniel Watkins
As the nose docs[0] themselves note, it has been in maintenance mode for the past several years. pytest is an actively developed, featureful and popular alternative that the nose docs themselves recommend. See [1] for more details about the thinking here. (This PR also removes stale tox definitions, instead of modifying them.) [0] https://nose.readthedocs.io/en/latest/ [1] https://lists.launchpad.net/cloud-init/msg00245.html
2019-09-18tools: make clean now cleans the dev directory, not the systemChad Smith
Remove pyc files, .tox directories and docs during make clean.
2019-09-07doc: document doc, create makefile and tox targetJoshua Powers
* Create makefile and tox targets for documentation building and testing to better replicate the live web docs using the same theme. * Created docs.rst to explain how to build and contribute to documentation with style guide and tips. * doc/rtd/conf.py:     * Add copyright to rtd config     * Use Sphinx's RTD theme to replicate actual docs
2017-09-20tests: Add cloudinit package to all test targetsChad Smith
The package cloudinit was sparsely added to only the makefile's unittest target and tox's py3 target. This branch adds cloudinit package to 'make unittest3' and all tox environments. It tweaks one cloudinit unit test to use mocked_object.call_count instead of mocked_object.assert_called_once which is not defined in some python unittest versions.
2017-09-20Makefile: No longer look for yaml files in obsolete ./bin/.Scott Moser
The bin/ dir was deleted some time ago, but the Makefile was still searching for files down it. This didn't cause any problems other Than a wierd looking error message in a build log.
2017-08-21tools: Add tooling for basic cloud-init performance analysis.Chad Smith
This branch adds cloudinit-analyze into cloud-init proper. It adds an "analyze" subcommand to the cloud-init command line utility for quick performance assessment of cloud-init stages and events. On a cloud-init configured instance, running "cloud-init analyze blame" will now report which cloud-init events cost the most wall time. This allows for quick assessment of the most costly stages of cloud-init. This functionality is pulled from Ryan Harper's analyze work. The cloudinit-analyze main script itself has been refactored a bit for inclusion as a subcommand of cloud-init CLI. There will be a followup branch at some point which will optionally instrument detailed strace profiling, but that approach needs a bit more discussion first. This branch also adds: * additional debugging topic to the sphinx-generated docs describing cloud-init analyze, dump and show as well as cloud-init single usage. * Updates the Makefile unittests target to include cloudinit directory because we now have unittests within that package. LP: #1709761
2017-07-28makefile: fix ci-deps-ubuntu targetChad Smith
Remove errant hyphen in read-dependencies --distro ubuntu parameter for ci-deps-ubuntu. All system packages can now be installed for ubuntu with make ci-deps-ubuntu". [author: powersj, review:blackboxsw]
2017-06-14ci deps: Add --test-distro to read-dependencies to install all depsChad Smith
read-dependencies now takes --test-distro param to indicate we want to install all system package depenencies to allow for testing and building for our continous integration environment. It allows us to install all needed deps on a fresh system with: python3 ./tools/read-dependencies --distro ubuntu --test-distro [--dry-run]. Additionally read-dependencies now looks at what version of python is running the script (py2 vs p3) and opts to install python 2 or 3 system deps respectively. This behavior can still be overridden with python3 ./tools/read-dependencies ... --python-version 2. There are also some distro-specific packaging and test dependencies, like devscripts, tox and libssl-dev on debian or ubuntu. Those pkg dependencies have now been broken out from common pkg deps to avoid trying to install them on centos/redhat/suse.
2017-06-13pkg build ci: Add make ci-deps-<distro> target to install pkgsChad Smith
This change adds a couple of makefile targets for ci environments to install all necessary dependencies for package builds and test runs. It adds a number of arguments to ./tools/read-dependencies to facilitate reading pip dependencies, translating pip deps to system package names and optionally installing needed system-package dependencies on the local system. This relocates all package dependency and translation logic into ./tools/read-dependencies instead of duplication found in packages/brpm and packages/bddeb. In this branch, we also define buildrequires as including all runtime requires when rendering cloud-init.spec.in and debian/control files because our package build infrastructure will also be running all unit test during the package build process so we need runtime deps at build time. Additionally, this branch converts packages/(redhat|suse)/cloud-init.spec.in from cheetah templates to jinja to allow building python3 envs.
2017-06-08cloud.cfg: move to a template. setup.py changes along the way.Scott Moser
Here we move the config/cloud.cfg to be rendered as a template. That allows us to maintain deltas between distros in one place. Currently we use 'variant' variable to make decisions. A tools/render-cloudcfg is provided to render the file. There were changes to setup.py, MANIFEST.in to allow us to put all files into a virtual env installation and to render the cloud-config file in 'install' or 'bdist' targets. We have also included some config changes that were found in the redhat distro spec. * include some config changes from the redhat distro spec. The rendered cloud.cfg has some differences. Ubuntu: white space and comment changes only. Freebsd: - whitespace changes and comment changes - datasource_list definition moved to be closer to 'datasource'. - enable modules: migrator, write_files - move package-update-upgrade-install to final. The initial work was done by Josh Harlow.
2017-06-08Makefile: add deb-src and srpm targets. use PYVER more places.Scott Moser
This just adds targets for deb-src and srpm, and uses PYVER anywhere where we run a python program.
2017-06-08makefile: fix python 2/3 detection in the MakefileChad Smith
Fix detection of python in a non-python3 environment. The old path always used python3. The 2 fixes here are: a.) escape the '$' before the subshell. b.) use shell builtin 'command -v' rather than 'which' in case 'which' is not available.
2017-05-16make deb: Add devscripts dependency for make deb. Cleanup packages/bddeb.Chad Smith
Add a simple dependency check to "make deb" target for devscripts. Rework a bit of the logic in package/bddeb to drop superfluous STD_NAMED_PACKAGES to avoid duplication of requirements already listed in (test-)?requiremets.txt. All "standard" packages can be assumed to have either python3- or python- prefix if not listed in NONSTD_NAMED_PACKAGES. This branch also moves logic inside write_debian_folder which is unneeded up in main. LP: #1685935
2017-02-06Remove style checking during build and add latest style checks to toxJoshua Powers
- make check will no longer run the style checks, that way package builds wont fail on a style difference in versions of the style tools in that distro. - created style-check make file target to continue to run pep8 and pyflakes - added tox envs 'tip-pycodestyle' and 'tip-pyflakes' to run latest style checking. These are not enabled by default run of tox. LP: #1652329
2017-01-23build: fix running Make on a branch with tags other than masterScott Moser
running 'make' on a git branch other than master would fail with complaint that the tools/read-version reported a different version than the code. Change to only consider tags starting with 0-9 in read-version.
2017-01-11validate-yaml: use python rather than explicitly python3Scott Moser
The change here is to use '/usr/bin/env python' in validate-yaml.py as all other tools/*.py do. Additionally, change the Makefile to invoke validate-yaml.py with the python that it has selected for other things (PYVER).
2016-08-05drop modification of version during make-tarball, tools changes.Scott Moser
Modification of the tarball became problematic, as it meant that any tool extracting source would find the orig source tarball different. I found this unusable when trying to use 'gbp buildpackage'. Other changes here are to better support using python3 or python2 for the build. Makefile will try to call the right python version and can be told which python to use. read-version: by adding 'tiny_p' and avoiding the import of cloudinit.util, we need less dependencies to run this.
2016-03-04Apply pep8, pyflakes fixes for python2 and 3Scott Moser
Update make check target to run pep8 and run pyflakes or pyflakes3 depending on the value of 'PYVER'. This way the python3 build environment does not need python2 and vice versa. Also have make check run the 'yaml' test. tox: have tox run pep8 in the pyflakes
2016-03-03Apply pep8, pyflakes fixes for python2 and 3 Ryan Harper
Update make check target to use pep8, pyflakes, pyflakes3.
2016-03-03Fix pyflake/pyflake3 errorsRyan Harper
Now we can run make check to assess pep8, pyflakes for python2 or 3 And execute unittests via nosetests (2 and 3).
2016-03-03Update pep8 runner and fix pep8 issuesRyan Harper
2016-03-03Makefile: add make check target to run pep8, pyflakes, unittestsRyan Harper
Run a check of pep8, pyflakes (py27), pyflakes3 (py34), and use nosetest and nosetest3 to run unittests. We should pass all of these.
2016-03-03make package build run testsScott Moser
2016-03-03run pyflakes in more places, fix falloutScott Moser
this makes 'make' run pyflakes, so failures there will stop a build. also adds it to tox.
2015-05-01fix 'Make pyflakes'Scott Moser
2014-08-26further remove evidence of pylint.Scott Moser
This just removes comments '# pylint:' things and other code remnents of pylint.
2014-08-26Remove pylintJay Faulkner
pylint was not passing, and per smoser in IRC pylint can/should be removed.
2014-01-20merge requirement changesJoshua Harlow
This splits up 'Requires' into requirements.txt and test-requirements.txt to differenciate the build dependencies and runtime dependencies. one sticky thing still exists in that the packages/bddeb doesn't: - list any Build-Depends - address versions in the requirements.txt
2014-01-19Add output when starting to run testsJoshua Harlow
2014-01-19Phony not phoneJoshua Harlow
2014-01-17Run pyc cleaning before running testsJoshua Harlow
2014-01-17Update makefile to install from updated requirements filesJoshua Harlow
2013-07-17fix indentation a bit in MakefileScott Moser
2013-06-27Add support for building a SLES rpm packageJuerg Haefliger
2012-11-14Add a check on the changelog version comparing to the code version.Joshua Harlow
2012-11-07Add a makefile yaml checking targetJoshua Harlow
and fix the cases where the cc yaml is not correct.
2012-11-07trivial: -name first is faster due to no need for statScott Moser
2012-10-27Helpful cleanups.harlowja
1. Remove the usage of the path.join function now that all code should be going through the util file methods (and they can be mocked out as needed). 2. Adjust all occurences of the above join function to either not use it or replace it with the standard os.path.join (which can also be mocked out as needed) 3. Fix pylint from complaining about the tests folder 'helpers.py' not being found 4. Add a pylintrc file that is used instead of the options hidden in the 'run_pylint' tool.
2012-08-09fix pylint in all files used by ./tools/run-pylintScott Moser
'make pylint' was not checking tests and tools. This fixies a bunch of pylint/pep8 issues in that code. It also enables 'make pylint' to check them.
2012-07-09Makefile: change deb and rpm targets to not change working dirScott Moser
'cd packages && ./bddeb' is no longer necessary.
2012-06-26Add a section for building an rpm and a section for building a debJoshua Harlow
2012-06-231. Separate the pep8 check from the pylint checkharlowja
a. This allows them to be run as different tools (if desired) 2. Adjust the makefile to have a 'make pep8' section which can run this new script
2012-06-21Pass along any environment settings via the variable 'noseopts'Joshua Harlow
2012-06-20Add in the new binary to be used in files found.Joshua Harlow
2012-06-181. Add in a clean section that will remove the /var/lib/cloud dir and the ↵Joshua Harlow
cloud.log file (helpful for testing)
2012-06-16Add the running of 2to3 via the makefile.Joshua Harlow
2012-06-15Updated so that pylint and pyflakes will now run over cloudinit/ and bin/ ↵Joshua Harlow
python files
2012-01-12Tweak Makefile to just run unittests for the "all" target.Mike Milner