diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index eb02481..5182efc 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -6,17 +6,30 @@ on: - 'v*' jobs: - deploy: - runs-on: ubuntu-latest + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-22.04 + # Specifying a GitHub environment is optional, but strongly encouraged + environment: pypi + permissions: + # IMPORTANT: this permission is mandatory for Trusted Publishing + id-token: write + steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: '3.7' - - name: Publish packages - env: - FLIT_USERNAME: __token__ - FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + + - name: Install dependencies run: | + python -m pip install --upgrade pip pip install flit - flit publish --setup-py + + - name: Build package + run: flit build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test-build-docs.yml b/.github/workflows/test-build-docs.yml index 0b81fa9..526dc8a 100644 --- a/.github/workflows/test-build-docs.yml +++ b/.github/workflows/test-build-docs.yml @@ -5,7 +5,7 @@ on: jobs: build-docs: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Set up Python diff --git a/esp_bool_parser/bool_parser.py b/esp_bool_parser/bool_parser.py index 943ef5d..97c2761 100644 --- a/esp_bool_parser/bool_parser.py +++ b/esp_bool_parser/bool_parser.py @@ -76,7 +76,6 @@ def get_value(self, target: str, config_name: str) -> t.Any: if self.attr == 'CONFIG_NAME': return config_name - # for non-keyword cap words, check if it is defined in the environment variables if self.attr in os.environ: return os.environ[self.attr]