Skip to content

Commit 9f654a0

Browse files
authored
Merge pull request #2 from stephen-zhao/develop/ou/20220125
Extend Dev Docs, Fix Publish Devops
2 parents 63f7d36 + 7c285a8 commit 9f654a0

File tree

4 files changed

+98
-6
lines changed

4 files changed

+98
-6
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ test: $(MARKER_REQUIREMENTS_SYNCED_DEVTIME)
200200

201201
.PHONY: publish
202202
publish:
203-
python3 -m twine upload dist/*
203+
$(PY_IN_VENV_EXE) -m twine upload dist/*
204204

205205
.PHONY: publish-test
206206
publish-test:
207-
python3 -m twine upload --repository testpypi dist/*
207+
$(PY_IN_VENV_EXE) -m twine upload --repository testpypi dist/*
208208

209209

210210
# ==================== Cleaning Up ====================

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,42 @@ ambiguous.
134134

135135
## Development
136136

137-
This project has an extensive `Makefile` for development automation.
137+
This project has an extensive `Makefile` for development automation. To get started quick: after cloning this project, run `make all`. This should create a virtual environment, install all the required dev-time packages, lint, build, and test the project.
138138

139-
After cloning this project, run `make all` to get started.
139+
### Virtual Environment Setup
140140

141-
This should create a virtual environment and install all the required dev-time packages.
141+
You only have to run these once. And `make all` covers these steps automatically, but this is here for your reference.
142+
143+
Use `make reinit-venv` to create a new virtual environment from scratch. This will live inside the project's root. All subsequent make commands will automatically invoke python from inside this virtual environment. You may rerun this to completely wipe the virtual environment and start from scratch.
144+
145+
Use `make init-piptools` to bootstrap the virtual environment.
146+
147+
### Dependency Management
148+
149+
To add more runtime dependencies on pypi packages, add them to `requirements.in`. Then use `make install-requirements` to install them.
150+
151+
To add more devtime dependencies (these will not be deemed dependencies in the distributable/built version of the package), add them to any `*.in` file within the `requirements-devtime.d/` directory. Then use `make install-requirements` to install them.
152+
153+
To upgrade the pinned dependencies, run `make upgrade-requirements`. This will re-resolve the requirements to the latest versions, pin the newly resolved versions, and install them.
154+
155+
### Building
156+
157+
`make all` is the one-stop shop for building the project. It will fix auto-fixable linting errors, raise any additional linting errors, build, run unit tests, and produce a coverage report.
158+
159+
To only check lints or fix lints, use `make lint` or `make fix-lint`.
160+
161+
To only build, use `make build`.
162+
163+
To only test, use `make test`.
164+
165+
### Publishing
166+
167+
Use `make publish-test` to publish to the test pypi repository.
168+
169+
Use `make publish` to publish to the prod repository.
170+
171+
### Cleaning
172+
173+
Use `make clean` to remove build artifacts.
174+
175+
Use `make reinit-venv` if you need to completely reset your virtual environment.

requirements-devtime.d/publish.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
twine

requirements-devtime.txt

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,52 @@
22
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
5-
# pip-compile --output-file=requirements-devtime.txt requirements-devtime.d/build.in requirements-devtime.d/lint.in requirements-devtime.d/test.in requirements.in
5+
# pip-compile --output-file=requirements-devtime.txt requirements-devtime.d/build.in requirements-devtime.d/lint.in requirements-devtime.d/publish.in requirements-devtime.d/test.in requirements.in
66
#
77
-e file:///mnt/c/Projects/Dev/datetime_matcher
88
# via -r requirements-devtime.d/test.in
99
attrs==21.4.0
1010
# via pytest
1111
black==21.12b0
1212
# via -r requirements-devtime.d/lint.in
13+
bleach==4.1.0
14+
# via readme-renderer
1315
build==0.7.0
1416
# via -r requirements-devtime.d/build.in
17+
certifi==2021.10.8
18+
# via requests
19+
cffi==1.15.0
20+
# via cryptography
21+
charset-normalizer==2.0.10
22+
# via requests
1523
click==8.0.3
1624
# via black
25+
colorama==0.4.4
26+
# via twine
1727
coverage[toml]==6.2
1828
# via pytest-cov
29+
cryptography==36.0.1
30+
# via secretstorage
31+
docutils==0.18.1
32+
# via readme-renderer
1933
flake8==4.0.1
2034
# via -r requirements-devtime.d/lint.in
35+
idna==3.3
36+
# via requests
37+
importlib-metadata==4.10.1
38+
# via
39+
# keyring
40+
# twine
2141
iniconfig==1.1.1
2242
# via pytest
2343
isort==5.10.1
2444
# via -r requirements-devtime.d/lint.in
45+
jeepney==0.7.1
46+
# via
47+
# keyring
48+
# secretstorage
49+
keyring==23.5.0
50+
# via twine
2551
mccabe==0.6.1
2652
# via flake8
2753
mypy==0.931
@@ -32,12 +58,15 @@ mypy-extensions==0.4.3
3258
# mypy
3359
packaging==21.3
3460
# via
61+
# bleach
3562
# build
3663
# pytest
3764
pathspec==0.9.0
3865
# via black
3966
pep517==0.12.0
4067
# via build
68+
pkginfo==1.8.2
69+
# via twine
4170
platformdirs==2.4.1
4271
# via black
4372
pluggy==1.0.0
@@ -46,8 +75,12 @@ py==1.11.0
4675
# via pytest
4776
pycodestyle==2.8.0
4877
# via flake8
78+
pycparser==2.21
79+
# via cffi
4980
pyflakes==2.4.0
5081
# via flake8
82+
pygments==2.11.2
83+
# via readme-renderer
5184
pyparsing==3.0.7
5285
# via packaging
5386
pytest==6.2.5
@@ -56,6 +89,20 @@ pytest==6.2.5
5689
# pytest-cov
5790
pytest-cov==3.0.0
5891
# via -r requirements-devtime.d/test.in
92+
readme-renderer==32.0
93+
# via twine
94+
requests==2.27.1
95+
# via
96+
# requests-toolbelt
97+
# twine
98+
requests-toolbelt==0.9.1
99+
# via twine
100+
rfc3986==2.0.0
101+
# via twine
102+
secretstorage==3.3.1
103+
# via keyring
104+
six==1.16.0
105+
# via bleach
59106
toml==0.10.2
60107
# via pytest
61108
tomli==1.2.3
@@ -65,7 +112,17 @@ tomli==1.2.3
65112
# coverage
66113
# mypy
67114
# pep517
115+
tqdm==4.62.3
116+
# via twine
117+
twine==3.7.1
118+
# via -r requirements-devtime.d/publish.in
68119
typing-extensions==4.0.1
69120
# via
70121
# black
71122
# mypy
123+
urllib3==1.26.8
124+
# via requests
125+
webencodings==0.5.1
126+
# via bleach
127+
zipp==3.7.0
128+
# via importlib-metadata

0 commit comments

Comments
 (0)