Skip to content

Commit f22184e

Browse files
authored
Merge pull request #3 from cortze/pypi-integration
rename module
2 parents cff89b1 + a26872e commit f22184e

File tree

11 files changed

+78
-25
lines changed

11 files changed

+78
-25
lines changed

.github/workflows/module_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ jobs:
5656
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
5757
- name: Test with unittest
5858
run: |
59-
python -m unittest tests/module.py
59+
python -m unittest tests/test_module.py
6060

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install setuptools wheel twine
18+
- name: Build and publish
19+
env:
20+
TWINE_USERNAME: __token__
21+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
22+
run: |
23+
python setup.py sdist bdist_wheel
24+
twine upload dist/*

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@
55
venv/
66

77
# caches
8-
*/__pycache__/
8+
*/__pycache__/
9+
10+
# PyPI integration file
11+
./build
12+
./dist
13+
*.egg-info

dbtest/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

pyproject.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[build-system]
2+
requires = ["setuptools", "setuptools_scm[toml]"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "unit-db-test"
7+
description = "Unittest wrapper focused on making DB integrity tests"
8+
readme = "README.md"
9+
license = {file = "LICENSE"}
10+
maintainers = [
11+
{name = "@cortze | Mikel Cortes ", email = "[email protected]"},
12+
]
13+
requires-python = ">=3.10"
14+
dependencies = [
15+
'dotenv',
16+
'unittest',
17+
'psycopg2-binary',
18+
'sqlalchemy',
19+
'pandas',
20+
]
21+
22+
dynamic = [
23+
"version",
24+
]
25+
26+
[tool.setuptools_scm]
27+
28+
[project.urls]
29+
Repository = "https://github.com/cortze/unit-db-test"
30+
31+
[tool.setuptools.packages.find]
32+
include = [
33+
"unit_db_test*",
34+
]

setup.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
# setup.py
2-
from setuptools import setup
1+
#!/usr/bin/env python
32

4-
setup(
5-
name='dbtest',
6-
version='0.1',
7-
packages=['dbtest'],
8-
install_requires=[
9-
'dotenv',
10-
'unittest',
11-
'psycopg2-binary',
12-
'sqlalchemy',
13-
'pandas',
14-
],
15-
)
3+
import setuptools
4+
5+
if __name__ == "__main__":
6+
setuptools.setup()

tests/module.py renamed to tests/test_module.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import unittest
2-
from dbtest.unittest import DBintegrityTest
2+
import unit_db_test.testcase as dbtest
33

4-
5-
class TestDBTestModule(DBintegrityTest):
4+
class TestDBTestModule(dbtest.DBintegrityTest):
65
db_config_file = '.env'
76

87
def test_not_null_items_in_column(self):

unit_db_test/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from unit_db_test.testcase import *
2+
from unit_db_test.postgresql import *
3+
from unit_db_test.utils import *
File renamed without changes.

dbtest/unittest.py renamed to unit_db_test/testcase.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# db_unit_tests.py
1+
# testcase.py
22
import pandas as pd
33
import unittest
44

5-
from dbtest.postgresql import Postgres
6-
from dbtest.utils import load_credentials_from
5+
from unit_db_test.postgresql import Postgres
6+
from unit_db_test.utils import load_credentials_from
77

88

99

0 commit comments

Comments
 (0)