-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
…dated.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
environment: release | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,28 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
name: Publish to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
deploy: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
environment: release | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: pip install poetry | ||
|
||
- name: Build and publish | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
poetry build | ||
poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"njpwerner.autodocstring", | ||
"esbenp.prettier-vscode", | ||
"ms-toolsai.jupyter", | ||
"tamasfe.even-better-toml", | ||
"ms-python.black-formatter" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"python.analysis.typeCheckingMode": "off", | ||
"python.analysis.autoImportCompletions": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Development Environment Setup | ||
|
||
This guide outlines the setup process for our development environment, focusing on packaging and dependency management. | ||
## Info on dev setup | ||
### Poetry for Packaging and Dependency Management | ||
|
||
We use [Poetry](https://python-poetry.org/docs/main/#installation) as our primary tool for packaging and managing dependencies. Poetry provides a simple yet powerful way to manage project dependencies and publish packages. | ||
|
||
For the most detailed and up-to-date information, please refer to the [official Poetry 📚](https://python-poetry.org/docs/main/#installation). | ||
|
||
### Installing Python CLI Applications Globally with pipx | ||
|
||
To ensure that Python CLI applications are installed globally on your system while being isolated in their own virtual environments, we utilize `pipx`. | ||
|
||
## Steps to Install pipx and Poetry | ||
|
||
1. First, [install pipx](https://pipx.pypa.io/stable/installation/) following the instructions on the official website. | ||
2. Once pipx is installed, you can easily install Poetry by running the following command in your terminal: | ||
```pipx install poetry``` | ||
3. (*optional*) [install](vscode:extension/zeshuaro.vscode-python-poetry) vscode extension for poetry | ||
### Setup with Poetry | ||
```shell | ||
poetry install | ||
``` | ||
### publishing with poetry | ||
https://python-poetry.org/docs/repositories/ | ||
## Remarks for devcontainer | ||
|
||
You can also work inside a docker container(devcontainer). | ||
To make sure you have access/permissions inside the devcontainer. | ||
From inside the devcontainer after launch, check user and take ownership: | ||
|
||
```bash | ||
whoami | ||
sudo chown -R $USER:$USER /workspaces/ -R | ||
``` | ||
|
||
other option is to run as root from within the `devcontainer.json` `"remoteUser": "root"` | ||
|
||
# Useful commands for dev work | ||
## clean up | ||
[vulture](https://github.com/jendrikseipp/vulture) for finding dead python 🐍 | ||
```pipx run vulture . --exclude venv``` | ||
|
||
[deptry](https://github.com/fpgmaas/deptry) for checking dependencies | ||
```pipx run deptry .``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# OpenEnergyID | ||
|
||
Open Source Python library for energy data analytics and simulations | ||
|
||
[*more info for developers*](DEVELOPERS.md) |