From 275fd08d675b7970cad8d94d69689b4e1e4a722b Mon Sep 17 00:00:00 2001 From: Anthony Scopatz Date: Fri, 19 Feb 2016 00:03:09 -0500 Subject: [PATCH] removes Makefile and related content --- Makefile | 50 --------------------------------------- docs/devguide.rst | 54 ++++++++++++++----------------------------- scripts/run_tests.xsh | 12 ++++++---- 3 files changed, 25 insertions(+), 91 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index d627223c3..000000000 --- a/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -SHELL = /bin/sh - -which = edited # which tests to run - -all: - @echo "You must specifiy a make target." - @echo "Targets are:" - @echo " clean" - @echo " lint" - @echo " lint-all" - @echo " test" - @echo " test-all" - @echo " build-tables" - -clean: - rm -f xonsh/lexer_table.py xonsh/parser_table.py - rm -f xonsh/lexer_test_table.py xonsh/parser_test_table.py - rm -f xonsh/*.pyc tests/*.pyc - rm -f xonsh/*.rej tests/*.rej - rm -fr build - -# Line just the changed python files. It doesn't matter if "git add" has -# already been done but obviously if you've already done "git commit" then -# they're no longer consider changed. This should be run (along with "make -# test") before commiting a set of changes. -lint: - pylint $$(git status -s | awk '/\.py$$/ { print $$2 }' | sort) - -# Lint all the python files. -lint-all: - make clean - pylint $$(find tests xonsh -name \*.py | sort) - -# Test just the changed python files. It doesn't matter if "git add" has -# already been done but obviously if you've already done "git commit" then -# they're no longer consider changed. This should be run (along with "make -# lint") before commiting a set of changes. You can also pass a list of test -# names via a "which=name1 name2..." argument. -test: - scripts/run_tests.xsh $(which) - -# Test all the python files. -test-all: - scripts/run_tests.xsh all - -# Build the parser_table.py module. This is normally done by setup.py at -# install time. This just makes it easy to create the parser module on the fly -# to facilitate development. -build-tables: - python3 -c 'import setup; setup.build_tables()' diff --git a/docs/devguide.rst b/docs/devguide.rst index 9cca5add6..208a0bbb1 100644 --- a/docs/devguide.rst +++ b/docs/devguide.rst @@ -64,13 +64,13 @@ is open to interpretation. You can easily check for style issues, including some outright bugs such as mispelled variable names, using pylint. If you're using Anaconda you'll need to run "conda install pylint" once. You can easily run pylint on -the edited files in your uncommited git change: +the edited files in your uncommited git change:: - $ make lint + $ pylint $(git status -s | awk '/\.py$$/ { print $$2 }' | sort) -If you want to lint the entire code base run: +If you want to lint the entire code base run:: - $ make lint-all + $ pylint $(find tests xonsh -name \*.py | sort) How to Test ================ @@ -78,40 +78,20 @@ First, install nose: http://nose.readthedocs.org/en/latest/. Second, ensure your cwd is the root directory of the project (i.e., the one containing the .git directory). -To perform all unit tests: +To perform all unit tests:: - $ make test-all - -Or, if if make isn't available to you (e.g., you're on MS-Windows) invoke -the script directly: - - $ scripts/run-tests.xsh - -Or, you can do it the hard way: - - $ python3 -c 'import setup; setup.build_tables()' - $ env XONSHRC='' nosetests - -If you want to test the xonsh code that is installed on your system first -cd into the ``tests`` directory then run the tests: - - $ cd tests - $ env XONSHRC='' nosetests + $ scripts/run_tests.xsh all If you're working on a change and haven't yet committed it you can run the tests associated with the change. This does not require that the change include the unit test module. This will execute any unit tests that are part of the change as well as the unit tests for xonsh source modules in -the change: +the changes:: - $ make test + $ scripts/run_tests.xsh $(which) If you want to run specific tests you can specify the test names to -execute. For example to run test_aliases: - - $ make test which=aliases - -Or, if make isn't available run the test script directly: +execute. For example to run test_aliases:: $ scripts/run_tests.xsh aliases @@ -120,16 +100,12 @@ the ``test_`` prefix and ``.py`` suffix without the directory (e.g., ``test_aliases.py``), or the complete relative path (e.g., ``tests/test_aliases.py``). For example: -Note that you can pass multiple test names in the above examples: - - $ make test which='aliases environ' - -Or: +Note that you can pass multiple test names in the above examples:: $ scripts/run_tests.xsh aliases environ As before, if you want to test the xonsh code that is installed on your -system first cd into the `tests` directory then run the tests: +system first cd into the `tests` directory then run the tests:: $ cd tests $ env XONSHRC='' nosetests test_aliases.py test_environ.py @@ -304,9 +280,13 @@ When releasing xonsh, make sure to do the following items in order: Maintenance Tasks -------------------- You can cleanup your local repository of transient files such as \*.pyc files -created by unit testing by running: +created by unit testing by running:: - $ make clean + $ rm -f xonsh/lexer_table.py xonsh/parser_table.py + $ rm -f xonsh/lexer_test_table.py xonsh/parser_test_table.py + $ rm -f xonsh/*.pyc tests/*.pyc + $ rm -f xonsh/*.rej tests/*.rej + $rm -fr build ----------------------- Performing the Release diff --git a/scripts/run_tests.xsh b/scripts/run_tests.xsh index 6d96575db..29f1dbd33 100755 --- a/scripts/run_tests.xsh +++ b/scripts/run_tests.xsh @@ -19,11 +19,13 @@ if not os.path.isdir('.git'): if len($ARGS) == 1: # Run all tests. - $[make build-tables] # ensure lexer/parser table module is up to date + # ensure lexer/parser table module is up to date + $[python3 -c 'import setup; setup.build_tables()'] $[env XONSHRC='' nosetests] elif len($ARGS) == 2 and $ARG1 == 'all': # Run all tests. - $[make build-tables] # ensure lexer/parser table module is up to date + # ensure lexer/parser table module is up to date + $[python3 -c 'import setup; setup.build_tables()'] $[env XONSHRC='' nosetests] elif len($ARGS) == 2 and $ARG1 == 'edited': # Run just the tests for the files edited in the uncommited change. @@ -42,7 +44,8 @@ elif len($ARGS) == 2 and $ARG1 == 'edited': format(edited_fname), file=sys.stderr) if tests: - $[make build-tables] # ensure lexer/parser table module is up to date + # ensure lexer/parser table module is up to date + $[python3 -c 'import setup; setup.build_tables()'] $[env XONSHRC='' nosetests -v @(sorted(tests))] else: print('Cannot find any tests in the pending changes.', file=sys.stderr) @@ -62,7 +65,8 @@ else: format(test_fname), file=sys.stderr) if tests: - $[make build-tables] # ensure lexer/parser table module is up to date + # ensure lexer/parser table module is up to date + $[python3 -c 'import setup; setup.build_tables()'] $[env XONSHRC='' nosetests -v @(sorted(tests))] else: print('Cannot find any tests matching {}.'.format($ARGS[1:]),