Skip to content

Commit

Permalink
V0.0.1 test check
Browse files Browse the repository at this point in the history
  • Loading branch information
Arman Jasuja committed Jul 5, 2024
1 parent 4ebae38 commit 8d99fe8
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 51 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches: ['*']
release:
types: [created]

jobs:
test-pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install tox
- name: Install loggingredactor
run: |
pip install -e .
- name: Run pytest
run: tox -e py37

test-flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install tox
- name: Install loggingredactor
run: |
pip install -e .
- name: Run flake8
run: tox -e flake8

tag:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Git config
run: |
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
- name: Get version from setup.py
id: get_version
run: echo "::set-output name=version::$(python setup.py --version)"
- name: Create tag
run: |
git tag -a ${{ steps.get_version.outputs.version }} -m "Version created by GitHub Actions"
git push origin ${{ steps.get_version.outputs.version }}
pypi-package:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: pip install twine
- name: Build package
run: |
rm -f dist/*
python setup.py sdist bdist_wheel
- name: Publish to PyPI
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
45 changes: 0 additions & 45 deletions .gitlab-ci.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
long_description = ""

setup(
name="logredactor",
name="loggingredactor",
packages=find_packages(),
version="0.0.2",
url="https://github.com/xtream1101/logredactor",
description="Redact logs based on regex filters",
version="0.0.1",
url="https://github.com/armurox/loggingredacto",
description="Redact logs based on regex filters and keys",
long_description=long_description,
long_description_content_type="text/markdown",
)
4 changes: 2 additions & 2 deletions tests/test_redacting_filter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import pytest
import logging
import logredactor
import loggingredactor


@pytest.fixture
Expand All @@ -10,7 +10,7 @@ def get_logger(filters):
# Use the test functions name to get a unique logger for that test
logger = logging.getLogger(request.node.name)
logger.addFilter(
logredactor.RedactingFilter(
loggingredactor.RedactingFilter(
filters,
default_mask='****',
mask_keys={'phonenumber',}
Expand Down

0 comments on commit 8d99fe8

Please sign in to comment.