Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/migrate to poetry #24

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: "3.8.0"
python-version: "3.9.0"
- name: flake8 Lint
uses: py-actions/flake8@v2
15 changes: 12 additions & 3 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: "3.8.0"
- name: Install dependencies and test with unittest
python-version: "3.9.0"
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# installer-parallel: true
- name: Install dependencies
run: |
poetry install
- name: Run unittests
run: |
pip install -e .
source .venv/bin/activate
python -m unittest -v
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/


.DS_Store
poetry.lock
20 changes: 0 additions & 20 deletions .vscode/tasks.json

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This project helps separate the database and report logging from [`python_db_log
There are two methods to install this package in your project,

- Using `pyproject.toml`:
- Add `"report_handler @ git+https://git@github.com:/ctsit/report_handler.git"` in the `dependencies` section of the file.
- Run `pip3 install .` to install in the virtual environment.
- Add `report-handler = { git = "https://github.com/ctsit/report_handler.git", rev = "master", tag = "1.2.0" }` in the `tool.poetry.dependencies` section of the file.
- Run `poetry install` to install in the virtual environment.
- Using `setup.py`:
- Add `"report_handler @ git+https://[email protected]:/ctsit/report_handler.git"` in the `install_requires` section of the file.
- Run `pip3 install .` to install in the virtual environment.
Expand Down Expand Up @@ -68,6 +68,7 @@ logger = logging.getLogger()
logger.addHandler(report_handler)
```

Note: By default the `ReportHandler` will only capture logs that provide the dictionary (defined below) in the `extra` keyword argument of logging calls. To capture all logs without providing the dictionary, set the `verbose` flag in the `ReportHandler` constructor to `True`, i.e., `report_handler = ReportHandler(verbose=True)`.
To log, call the following functions as required by the logging level:

```python
Expand Down
3 changes: 3 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[virtualenvs]
in-project = true
create = true
32 changes: 16 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[project]
[tool.poetry]
name = "report_handler"
version = "1.2.0"
description = ""
authors = [
{ name="Kshitij Sinha", email="[email protected]" },
{ name="Michael Bentz", email="[email protected]" }
"Kshitij Sinha <[email protected]>",
"Michael Bentz <[email protected]>",
]
description = ""
license = "MIT"
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"XlsxWriter==3.0.6",
"pandas>=2.0.3",
"openpyxl>=3.1.2"
]

[project.urls]
[tool.poetry.dependencies]
python = "^3.9"
XlsxWriter = "^3.0.6"
pandas = "^2.0.3"
openpyxl = "^3.1.2"

[tool.poetry.urls]
"Homepage" = "https://github.com/ctsit/report_handler"
"Bug Tracker" = "https://github.com/ctsit/report_handler/issues"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading