Skip to content

Commit b61e2b1

Browse files
authored
Merge pull request #3 from fopina/improve_readme
multiple
2 parents d016117 + f1d980d commit b61e2b1

6 files changed

Lines changed: 106 additions & 26 deletions

File tree

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Build
2+
3+
This project uses a `Pipfile`, so set up the virtualenv by running
4+
5+
```
6+
pipenv install --dev
7+
```
8+
9+
Use `make test` to make sure all tests pass before pushing.
10+
11+
Use `make lint` to make sure lint check passes before pushing.
12+
13+
## Guidelines
14+
15+
...

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
lint:
22
ruff format
33
ruff check --fix
4+
pyproject-pipenv --fix
45

56
lint-check:
67
ruff format --diff
78
ruff check
9+
pyproject-pipenv
810

911
test:
1012
python -m pytest --cov

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pytest = "*"
66
pytest-cov = "*"
77
twine = "*"
88
build = "*"
9+
pyproject-pipenv = "*"
910

1011
[requires]
1112
python_version = "3.10"

Pipfile.lock

Lines changed: 40 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
* `pytest` for tests: `make test`
1212
* `ruff` for linting/formatting: `make lint` (replaces both `black` and `isort`)
13+
* [pyproject-pipenv](https://github.com/fopina/pyproject-pipenv) to make sure dependencies in pyproject.toml and Pipfile are in sync
1314
* `.github` with actions ready to be used
14-
* [test](.github/workflows/test.yml) runs lint checks and unit tests
15-
* [publish-dev](.github/workflows/publish-dev.yml) publishes feature branches (`dev`/`dev-*`) to [testpypi](https://test.pypi.org)
15+
* [test](.github/workflows/test.yml) runs lint checks, unit tests and pyproject-pipenv
16+
* [publish-dev](.github/workflows/publish-dev.yml) publishes feature branches (`dev`/`dev-*`) to [testpypi](https://test.pypi.org) - more about this on [Notes](#feature-branch-publishing)
1617
* [publish-main](.github/workflows/publish-main.yml) publishes semver tags to [pypi](https://pypi.org)
1718

1819
## New project checklist
@@ -23,3 +24,47 @@
2324
* [ ] Add PYPI credentials to secrets
2425
* `PYPI_USERNAME` and `PYPI_TOKEN` to publish tags to pypi
2526
* `TESTPYPI_USERNAME` and `TESTPYPI_TOKEN` to publish dev branches to testpypi
27+
* [ ] Replace this README.md - template below
28+
29+
## Notes
30+
31+
### Feature branch publishing
32+
33+
`publish-dev` workflow publishes `dev`/`dev-*` branches to [testpypi](https://test.pypi.org).
34+
35+
Other common approach to publish dev branches is to use pre-release channels: version the package with a `rc` or `beta` suffix (such as `1.0.0-beta1`) and pypi will consider pre-release. In order to install this, the user needs to do `pip install PACKAGE --pre` otherwise the latest stable is picked up.
36+
However this will "pollute" your pypi index and it still requires you to bump the version (`1.0.0-beta1` < `1.0.0`) or to install the branch using specific version.
37+
38+
Yet another approach is to simply use an entirely different package name for the dev releases. Tensorflow does that, for example, with [tf-nightly](https://pypi.org/project/tf-nightly/).
39+
40+
## ---
41+
42+
# fp-github-template-example
43+
44+
CLI that echos whatever you tell it to.
45+
46+
## Install
47+
48+
```
49+
pip install fp-github-template-example
50+
```
51+
52+
## Usage
53+
54+
```
55+
$ example-cli
56+
Got nothing to say?
57+
58+
$ example-cli hello
59+
HELLO right back at ya!
60+
```
61+
62+
```python
63+
>>> from example import demo
64+
>>> demo.echo('ehlo')
65+
'EHLO right back at ya!'
66+
```
67+
68+
## Build
69+
70+
Check out [CONTRIBUTING.md](CONTRIBUTING.md)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Homepage = "https://github.com/fopina/python-package-template"
1919

2020
[project.scripts]
2121
# TODO: remove this if package is not a CLI or update it if it is
22-
example-cli = "example.__main__:cli"
22+
example-cli = "example.__main__:main"
2323

2424
[tool.setuptools.packages.find]
2525
# TODO: replace example with your package name

0 commit comments

Comments
 (0)