Skip to content

Make targets for a virtualenv #1280

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

Merged
merged 3 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ jsonschema-*.txt
relative-json-pointer.html
relative-json-pointer.pdf
relative-json-pointer.txt

# For the Python enviornment
.venv
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
XML2RFC ?= xml2rfc
VENV ?= .venv

OUT = \
jsonschema-core.html jsonschema-core.txt \
jsonschema-validation.html jsonschema-validation.txt \
relative-json-pointer.html relative-json-pointer.txt


all: $(OUT)
all: $(VENV) $(OUT)

%.txt: %.xml
$(XML2RFC) --text $< -o $@
Expand All @@ -25,7 +25,15 @@ json-schema.tar.gz: $(OUT)
tar -czf json-schema.tar.gz --exclude '.*' json-schema
rm -rf json-schema

clean:
$(VENV): requirements.txt
python -m venv $@
$@/bin/python -m pip install --upgrade pip
$@/bin/python -m pip install -r $<

spec-clean:
rm -f $(OUT) json-schema.tar.gz

.PHONY: clean all
clean: spec-clean
rm -rf $(VENV)

.PHONY: spec-clean clean all
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@ Labels are assigned based on [Sensible Github Labels](https://github.com/Releque
* links.json - JSON Hyper-Schema's Link Description Object meta-schema
* hyper-schema-output.json - The recommended output format for JSON Hyper-Schema links

Install "xml2rfc" using "pip" (https://pypi.org/project/xml2rfc/) and type "make" at a shell to build the .txt and .html spec files:
The Makefile will create the necessary Python venv for you as part of the regular make target.

`make clean` will remove all output including the venv. To clean just the spec output and
keep the venv, use `make spec-clean`.

If you want to run `xml2rfc` manually after running make for the first time, you will
need to activate the virtual environment:

```sh
pip install --requirement requirements.txt
make
source .venv/bin/activate
```

The version of "xml2rfc" that this project uses is updated by modifying `requirements.in` and running `pip-compile requirements.in`.
Expand Down