Skip to content

Commit

Permalink
align to davidkhala@poetry-buildpack
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkhala committed Jan 3, 2025
1 parent 54f42c0 commit e369f33
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 136 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install Poetry
uses: snok/install-poetry@main
- name: Install dependencies
run: poetry install --all-extras
- run: poetry run pytest
working-directory: test
- uses: davidkhala/poetry-buildpack@main
with:
test-entry-point: test

3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install Poetry
uses: snok/install-poetry@main
- uses: snok/install-poetry@main
- run: poetry build
- run: poetry config http-basic.pypi __token__ ${{secrets.PYPI_TOKEN}}
- run: poetry publish
133 changes: 5 additions & 128 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,128 +1,5 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
.pytest_cache
dist
poetry.lock
.idea
__pycache__
10 changes: 10 additions & 0 deletions poetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ curl https://raw.githubusercontent.com/davidkhala/python-utils/refs/heads/main/p
`poetry install --no-root` compared to `poetry update`
- Beyond dependencies, it can install current python module into context for reuse (e.g. use in tests)
- It will respect lock file
### non package mode
by specify `package-mode = false` under section `[tool.poetry]`

You can
- skip requirements to specify mandatory `name`, `version`, `description` or `authors` value in section

While you cannot
- define scripts in the [tool.poetry.scripts] section
- reference and import you local python module


## publish
- `poetry publish --build` will prompt for confirm
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ authors = ["David Liu <[email protected]>"]
readme = "README.md"
packages = [{ include = "davidkhala" }]

[tool.poetry.scripts]
test = "pytest:main"

[tool.poetry.dependencies]
python = "^3.10"
# for extras
Expand Down
Empty file removed test/artifacts/.gitkeep
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions tests/artifacts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.json
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e369f33

Please sign in to comment.