Skip to content

Commit

Permalink
🐛 Fix missing files
Browse files Browse the repository at this point in the history
Add make help
  • Loading branch information
Freed-Wu committed Dec 3, 2022
1 parent d410c5d commit 8ea4fbb
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 30 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
runs-on:
- ubuntu-latest
- macos-latest
# - windows-latest
neovim:
- true
- false
Expand Down Expand Up @@ -59,7 +58,6 @@ jobs:
runs-on:
- ubuntu-latest
- macos-latest
# - windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
Expand All @@ -72,7 +70,7 @@ jobs:
pip install build
- name: Build
run: |
python -m build
make dist
- uses: actions/upload-artifact@v3
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/src/*/external/*/__init__.py
_version.py

# create by https://github.com/iamcco/coc-gitignore (Sat Nov 26 2022 21:11:16 GMT+0800 (China Standard Time))
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ build:
pre_build:
- pip install build
- pip install -e .
- make build
- make build-docs

sphinx:
configuration: docs/conf.py
Expand Down
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PY = $(shell find src -name *.py) $(GENERATE_PY)
default: install

.PHONY: all
all: build install
all: test dist build-docs doc

.PHONY: install
install: install-bin install-man install-completions
Expand All @@ -28,9 +28,16 @@ install: install-bin install-man install-completions
install-bin: $(PY)
pip install '.$(EXTRA)'

.PHONY: install-bin-editable
install-bin-editable: $(PY)
pip install -e '.$(EXTRA)'

%/_version.py:
python -m build

dist: $(PY)
python -m build

src/translate_shell/external/%/__init__.py: scripts/generate-__init__.py.py src/translate_shell/external/%/__main__.py templates/__init__.py
$^ > $@

Expand All @@ -56,8 +63,8 @@ uninstall:
rm -rf $(BASH_COMPLETION) $(ZSH_COMPLETION) $(TCSH_COMPLETION) $(MANPATH)
pip uninstall $(LIBNAME)

.PHONY: build
build: docs/_build/html docs/.gitignore
.PHONY: build-docs
build-docs: docs/_build/html docs/.gitignore

docs/_build/html: docs/conf.py $(MARKDOWN) $(PY)
sphinx-build docs $@
Expand Down Expand Up @@ -88,10 +95,14 @@ addon-info.json: scripts/generate-addon-info.json.py pyproject.toml $(PY)
.PHONY: clean
clean:
rm -rf docs/_build docs/.gitignore $(GENERATE_MARKDOWN) $(GENERATE_PY) \
src/*.egg_info dist addon-info.json
src/*.egg-info dist addon-info.json

.PHONY: test
test: $(DOC_DEPENDS)
$(THEMIS)
pytest --cov
pre-commit run

.PHONY: help
help:
@cat docs/resources/make.md
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resources/requirements
resources/man
resources/translator
resources/config
resources/development
resources/make
```

```{toctree}
Expand Down
19 changes: 0 additions & 19 deletions docs/resources/development.md

This file was deleted.

24 changes: 24 additions & 0 deletions docs/resources/make.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Make

## For Users

- `make help`: Print this file
- `make install`: Install all
- `make install-bin`: Install executable file
- `make install-man`: Install Man page
- `make install-completions`: Install all completions
- `make install-bash-completion`: Install completion for bash
- `make install-zsh-completion`: Install completion for zsh
- `make install-tcsh-completion`: Install completion for tcsh

## For Developers

- `make install-bin-editable`: Install executable file in editable mode
- `make clean`: Remove all generated files
- `make test`: Run test, in github action
- `make dist`: Build python wheel, in github action
- `make build-docs`: Build sphinx documents, in readthedocs
- `make doc`: Build vim documents, in pre-commit hook

Before `make test`, `make dist`, `make build-docs` and `make doc`, must make
sure `translate-shell` has been correctly installed.
2 changes: 1 addition & 1 deletion docs/resources/requirements.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cat requirements/rich.txt | perl -pe's/\s*#.*\n//g;s=(\S+)=- [\1](https://pypi.o

## dev

For unit test and code coverage rate test. See [development](resources/development.md#test)
For unit test and code coverage rate test.

```{eval-sh}
cat requirements/dev.txt | perl -pe's/\s*#.*\n//g;s=(\S+)=- [\1](https://pypi.org/project/\1)=g'
Expand Down
1 change: 0 additions & 1 deletion src/translate_shell/external/.gitignore

This file was deleted.

0 comments on commit 8ea4fbb

Please sign in to comment.