Skip to content

Commit

Permalink
Fix pep8 error (#169)
Browse files Browse the repository at this point in the history
* Fix pep8 error

The following error is found by pep8.

```
./pifpaf/__main__.py:18:1: F401 'operator' imported but unused
import operator
```

* Always build CI image locally

It seems there is a problem with the repository maintained under
the pifpaf GitHub account. This is a short-term workaround and drops
dependency on the registry and makes the image always built during
CI run.

* Fix AttributeError

This fixes the AttributeError caused by recent version of packaging
library.

* Replace os.getlogin

... according to the recommendation in the python documentation.
  • Loading branch information
kajinamit authored Feb 29, 2024
1 parent bcd836e commit 55954f9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/pifpaf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: sudo chown -R 1000:1000 $GITHUB_WORKSPACE
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
ci_image:
- 'Dockerfile'
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/pifpaf/ci:latest
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: .
Expand All @@ -45,6 +31,5 @@ jobs:
KAFKA_VERSION=${{ env.KAFKA_VERSION }}
ETCD_VERSION=${{ env.ETCD_VERSION }}
tags: ghcr.io/pifpaf/ci:latest
if: steps.changes.outputs.ci_image == 'true'
- name: Run tox
run: docker run --rm -v ${{ github.workspace }}:/home/pifpaf/pifpaf ghcr.io/pifpaf/ci:latest tox -e ${{ matrix.env }}
1 change: 0 additions & 1 deletion pifpaf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import importlib.metadata
import logging
import operator
import os
import signal
import sys
Expand Down
2 changes: 1 addition & 1 deletion pifpaf/drivers/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os
import uuid

import packaging
import packaging.version

from pifpaf import drivers

Expand Down
3 changes: 2 additions & 1 deletion pifpaf/drivers/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import getpass
import logging
import os

Expand All @@ -27,7 +28,7 @@ def _setUp(self):
os.mkdir(datadir)
os.mkdir(tempdir)

mysql_user_to_use = os.getlogin()
mysql_user_to_use = getpass.getuser()

c, _ = self._exec(["mysqld",
"--no-defaults",
Expand Down

0 comments on commit 55954f9

Please sign in to comment.