Comments (17)
IIRC, you need pytest-cov installed. Been a while, but IIRC you can use something like poetry run python -m pytest tests
since Poetry manages the venvs for you.
from python-itoolkit.
@jwoehr feel free to work on it if you like!
from python-itoolkit.
There might be a way to do this with pure pip nowadays since some recent PEPs, but I'm not sure on that process.
from python-itoolkit.
If you or active volunteers (I don't count myself as active) really want this, I won't object, but I won't be a fan.
I am in the camp that has always been and will always remain against in-line type annotations in Python. I think they really destroy the readability of the language, and we don't even get type enforcement or static-typing speed out of the deal. (Unlike many controversial PEPs, PEP 484 doesn't even mention the opposition, but it was vociferous on the python-dev list.)
I would be fully supportive of comment-based (or stub file) type annotations. I think the requirement for Python 3.8 or typed-ast
isn't particularly onerous, especially given that it would only be imposed on people who are already willing, able, and invested in setting up and using Sphinx.
from python-itoolkit.
Thanks for the input, @jkyeung. I'm very new to type hints, so I'm not sure the approach that I'd want to take just yet.
The biggest concern I had with Python 3.8 / typed-ast was whether that was supported by readthedocs.io, since that's where the documentation is hosted. I agree that setting up a Python 3.8 environment to build docs is not all that onerous, especially since very few people would be doing so.
from python-itoolkit.
Python 2 is no longer an issue, correct? Expired budgie.
from python-itoolkit.
Yeah, the current development release (2.0.0-dev) is Python 3.6+
from python-itoolkit.
The v1 branch still "supports" Python 2, but I don't anticipate many changes there.
from python-itoolkit.
I support the plan to add type annotation.
I don't currently have time to do that work, but I can help review it.
Or possibly later this year I may have time to work on it.
from python-itoolkit.
@kadler is anyone working on this?
@alanseiden and I were chatting on this today and I forked and converted a file.
Should I proceed thru the tree?
from python-itoolkit.
Trying to run tests but get error:
$ python -m pytest tests
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --cov=itoolkit
inifile: /home/jwoehr/work/python-itoolkit/setup.cfg
rootdir: /home/jwoehr/work/python-itoolkit
Any tips?
from python-itoolkit.
Thanks, that helps. Doing better now, 87 passed, but 16 fail with an error of the form:
_________________ ERROR at setup of test_idb2call_with_ibm_db __________________
file /home/jwoehr/work/python-itoolkit/tests/test_unit_idb2call.py, line 41
def test_idb2call_with_ibm_db(mocker, database_callproc):
E fixture 'mocker' not found
> available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, database, database_callproc, database_close_exception, database_execute, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, transport
> use 'pytest --fixtures [testpath]' for help on them.
/home/jwoehr/work/python-itoolkit/tests/test_unit_idb2call.py:41
mocker
is installed
from python-itoolkit.
Is it installed in poetry's venv? (eg. poetry run pip env
)
from python-itoolkit.
(test_venv) jwoehr@pop-os:~/work/python-itoolkit$ poetry run pip env
ERROR: unknown command "env"
(test_venv) jwoehr@pop-os:~/work/python-itoolkit$ poetry run pip list --local
Package Version
-------------- ----------
coverage 7.2.7
exceptiongroup 1.1.1
iniconfig 2.0.0
itoolkit 2.0.0.dev0
mock 5.0.2
packaging 23.1
pip 23.1.2
pluggy 1.2.0
pytest 7.4.0
pytest-cov 4.1.0
PyYAML 6.0
setuptools 59.6.0
tomli 2.0.1
wheel 0.40.0
from python-itoolkit.
Sorry, I gave the wrong command but you figured out what I meant.
Hmm, looks at the error message closer it looks like test_idb2call_with_ibm_db
is taking a fixture called "mocker". Seems to be provided by pytest-mock, which is not installed in your venv. It's listed in the dev-dependencies in pyproject.toml, though. Seems like they changed things since Poetry 1.2, which uses dependency groups instead now but should still be backward compatible.
Maybe try poetry install --with dev
?
from python-itoolkit.
I got it set up on my new system. Here's what I did:
- Install poetry https://python-poetry.org/docs/#installation
- Ran
poetry install
- Ran
poetry run python -m pytest
from python-itoolkit.
Phew. Got that to work. Side note: one must deactivate the venv one already created for poetry install
to work.
--------------------------------------------------------
TOTAL 700 247 65%
======================= 103 passed, 2 warnings in 0.33s ========================
from python-itoolkit.
Related Issues (20)
- Drop Python 3.4 Support HOT 4
- _direct.py needs more test coverage
- Transports need a way to indicate failure HOT 1
- Deprecate the trace functions for standard logging
- Run cl command to create a library in an IASP via DirectTransport on a French system failed HOT 1
- On Japanese or French systems run command via DatabaseTransport fails with ibm_db_dbi::Error HOT 3
- Provide a close() API to close database connections
- PyPI page is outdated HOT 5
- Is there a problem with the Japanese environment in iCmd5250 xml output? HOT 3
- What itoolkit version allows qtemp schema table access using iSqlQuery? HOT 6
- Improve README links on PyPI HOT 3
- RTVJOBA example works only with CCSID=37 HOT 3
- Errors using JayDeBeApi HOT 8
- DatabaseTransport should not close a connection HOT 14
- Stderr handling in SSH Transport can yield wrong results
- Running itool.call ends the program and does nothing HOT 7
- XML Special Character errors/handling HOT 1
- Fix license headers on source files HOT 2
- Error calling Receive DataQ API - QRCVDTAQ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-itoolkit.