-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a few nits dealing with updated makefile #4058
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ ALL_EXECUTABLE_SPEC_NAMES = \ | |
|
||
# A list of fake targets. | ||
.PHONY: \ | ||
check_toc \ | ||
clean \ | ||
coverage \ | ||
detect_errors \ | ||
|
@@ -39,7 +38,6 @@ NORM = $(shell tput sgr0) | |
|
||
# Print target descriptions. | ||
help: | ||
@echo "make $(BOLD)check_toc$(NORM) -- check table of contents" | ||
@echo "make $(BOLD)clean$(NORM) -- delete all untracked files" | ||
@echo "make $(BOLD)coverage$(NORM) -- run pyspec tests with coverage" | ||
@echo "make $(BOLD)detect_errors$(NORM) -- detect generator errors" | ||
|
@@ -85,7 +83,7 @@ $(ETH2SPEC): setup.py | $(VENV) | |
|
||
# Force rebuild/install the eth2spec package. | ||
eth2spec: | ||
$(MAKE) --always-make $(ETH2SPEC) | ||
@$(MAKE) --always-make $(ETH2SPEC) | ||
|
||
# Create the pyspec for all phases. | ||
pyspec: $(VENV) setup.py | ||
|
@@ -99,6 +97,8 @@ pyspec: $(VENV) setup.py | |
TEST_REPORT_DIR = $(PYSPEC_DIR)/test-reports | ||
|
||
# Run pyspec tests. | ||
# Note: for debugging output to show, print to stderr. | ||
# | ||
# To run a specific test, append k=<test>, eg: | ||
# make test k=test_verify_kzg_proof | ||
# To run tests for a specific fork, append fork=<fork>, eg: | ||
|
@@ -117,6 +117,7 @@ test: $(ETH2SPEC) pyspec | |
@mkdir -p $(TEST_REPORT_DIR) | ||
@$(PYTHON_VENV) -m pytest \ | ||
-n auto \ | ||
--capture=no \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI I usually use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah these are the same. I prefer using the long-form options in scripts. |
||
$(MAYBE_TEST) \ | ||
$(MAYBE_FORK) \ | ||
$(PRESET) \ | ||
|
@@ -193,10 +194,6 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \ | |
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \ | ||
$(wildcard $(SSZ_DIR)/*.md) | ||
|
||
# Check all files and error if any ToC were modified. | ||
check_toc: $(MARKDOWN_FILES:=.toc) | ||
@[ "$$(find . -name '*.md.tmp' -print -quit)" ] && exit 1 || exit 0 | ||
|
||
# Generate ToC sections & save copy of original if modified. | ||
%.toc: | ||
@cp $* $*.tmp; \ | ||
|
@@ -209,8 +206,12 @@ check_toc: $(MARKDOWN_FILES:=.toc) | |
echo "\033[1;34m See $*.tmp\033[0m"; \ | ||
fi | ||
|
||
# Check all files and error if any ToC were modified. | ||
_check_toc: $(MARKDOWN_FILES:=.toc) | ||
@[ "$$(find . -name '*.md.tmp' -print -quit)" ] && exit 1 || exit 0 | ||
|
||
# Check for mistakes. | ||
lint: $(ETH2SPEC) pyspec check_toc | ||
lint: $(ETH2SPEC) pyspec _check_toc | ||
@$(CODESPELL_VENV) . --skip "./.git,$(VENV),$(PYSPEC_DIR)/.mypy_cache" -I .codespell-whitelist | ||
@$(PYTHON_VENV) -m flake8 --config $(FLAKE8_CONFIG) $(PYSPEC_DIR)/eth2spec | ||
@$(PYTHON_VENV) -m flake8 --config $(FLAKE8_CONFIG) $(TEST_GENERATORS_DIR) | ||
|
@@ -235,17 +236,19 @@ gen_list: | |
done | ||
|
||
# Run one generator. | ||
# This will forcibly rebuild eth2spec just in case. | ||
# To check modules for a generator, append modcheck=true, eg: | ||
# make gen_genesis modcheck=true | ||
gen_%: MAYBE_MODCHECK := $(if $(filter true,$(modcheck)),--modcheck) | ||
gen_%: $(ETH2SPEC) pyspec | ||
gen_%: eth2spec | ||
@mkdir -p $(TEST_VECTOR_DIR) | ||
@$(PYTHON_VENV) $(GENERATOR_DIR)/$*/main.py \ | ||
--output $(TEST_VECTOR_DIR) \ | ||
$(MAYBE_MODCHECK) | ||
|
||
# Run all generators then check for errors. | ||
gen_all: $(GENERATOR_TARGETS) detect_errors | ||
gen_all: $(GENERATOR_TARGETS) | ||
@$(MAKE) detect_errors | ||
|
||
# Detect errors in generators. | ||
detect_errors: $(TEST_VECTOR_DIR) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I didn't find it in the previous PR, but here, it seems
eth2spec
command doesn't trigger the rebuild (compile from markdown file to .py files)?I think we need to trigger the
make pyspec
action:@$(PYTHON_VENV) setup.py pyspecdev
here, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be separate steps; the generators don't need it. Building eth2spec will compile the markdown files. These will exist in the build & venv dirs. And these are the files which are used by the generators. If I run
make clean
andmake gen_all
it will work withoutmake pyspec
.But for
make test
we do needmake pyspec
. It adds these to thetests
directory.