Skip to content

Commit

Permalink
Package publish workflow, changed package name
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3bl33d3r committed Nov 23, 2023
1 parent 31d6762 commit 6593787
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "DNSChef",
"name": "DNSChef-NG",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11",
"features": {
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/python-publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 Package to PyPi Testing

on:
workflow_dispatch:
#release:
# types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipx
pipx install poetry
- name: Build and publish package
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi --build
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ clean:
find . -name '.pytest_cache' -exec rm -rf {} +

tests:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
ruff --select=E9,F63,F7,F82 --show-source .
python -m pytest

requirements:
Expand Down
2 changes: 1 addition & 1 deletion dnschef/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import importlib.metadata

__version__ = importlib.metadata.version("dnschef")
__version__ = importlib.metadata.version("dnschef-ng")
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[tool.poetry]
name = "dnschef"
name = "dnschef-ng"
version = "0.7.0"
description = "A highly configurable DNS proxy for Penetration Testers and Malware Analysts"
authors = ["iphelix <iphelix@thesprawl.org>","byt3bl33d3r <byt3bl33d3r@pm.me>"]
readme = "README.md"
license = "BSD-3-Clause"
packages = [{include = "dnschef"}]
classifiers = [
"Environment :: Console",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from dnschef.api import app
from dnschef.protocols import start_server
from dnschef.utils import parse_config_file
from dnschef.logger import log, debug_formatter, json_capture_formatter
from dnschef.logger import log, json_capture_formatter #,debug_formatter
from fastapi.testclient import TestClient

#log.setLevel(logging.DEBUG)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_http_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_delete_record(api_test_client):
url="/",
content=json.dumps({"type": "A", "domain": "*.nashvillenibblers.com", "value": "192.168.69.69"}).encode()
)

assert r.status_code == 200

r = api_test_client.get("/")
Expand All @@ -44,14 +43,12 @@ def test_logs(api_test_client):
"/logs",
params={"name": "fuck.shit.com"}
)

assert r.status_code == 200
assert len(r.json())

r = api_test_client.get(
"/logs",
params={"name": "fuck.shit.com", "type": "A"}
)

assert r.status_code == 200
assert len(r.json())
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ async def test_config_parse(config_file):

@pytest.mark.asyncio
async def test_header():
assert __version__ in header
assert __version__ in header

0 comments on commit 6593787

Please sign in to comment.