Closed kloczek closed 1 year ago
Hi there - thank you for opening this issue. I'll take a look at these:
jc/parsers/dir.py:1
/home/tkloczko/rpmbuild/BUILD/jc-1.23.1/jc/parsers/dir.py:1: DeprecationWarning: invalid escape sequence \>
"""jc - JSON Convert `dir` command output parser
This one seems to be a false positive as it is misinterpreting C:\> dir | jc --dir
in the documentation as being an invalid escape sequence.
tests/test_plist.py::MyTests::test_plist_nextstep
/home/tkloczko/rpmbuild/BUILD/jc-1.23.1/jc/parsers/pbPlist/pbParser.py:114: DeprecationWarning: invalid escape sequence \$
result = re.search('^// !\$\*(.+?)\*\$!', self.data) # pylint: disable=anomalous-backslash-in-string
I'll take a closer look at this one. I wonder if this just needs to be converted to a raw string? e.g. r'^// !\$\*(.+?)\*\$!'
tests/test_plist.py::MyTests::test_plist_nextstep
/home/tkloczko/rpmbuild/BUILD/jc-1.23.1/jc/parsers/pbPlist/pbRoot.py:60: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
class pbRoot(collections.MutableMapping):
Looks like I can change the import on this without issue.
I think I have these fixed. Could you try from the dev
branch? Thanks!
OK will try that (will back shortly).
To be honest I have yet another issue. After install module in </install/prefix> I'm trying to generate bash completions file and it fazils with
+ /usr/bin/mkdir -p /home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.1-2.fc35.x86_64/usr/share/bash-completion/completions
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.1-2.fc35.x86_64/usr/bin/jc --bash-comp
jc: Error - Exit due to unexpected error:
NameError: name 'Name' is not defined
BTW why this file is generated? Why it is not maintained as separated files? 🤔 (maintaining that in the code is causing that it is embedded in the module code).
I think I have these fixed. Could you try from the
dev
branch? Thanks!
Cannot apply dev commits on top of last release.
warning: Downloading https://github.com/kellyjonbrazil/jc//archive/v1.23.1/jc-1.23.1.tar.gz to /home/tkloczko/rpmbuild/SOURCES/jc-1.23.1.tar.gz
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/5b06f849.patch#/jc-Fix-iwconfig-re_interface-regex.patch to /home/tkloczko/rpmbuild/SOURCES/jc-Fix-iwconfig-re_interface-regex.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/56259d56.patch#/jc-fix-for-dashes-in-name.patch to /home/tkloczko/rpmbuild/SOURCES/jc-fix-for-dashes-in-name.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/313bd86e.patch#/jc-doc-update.patch to /home/tkloczko/rpmbuild/SOURCES/jc-doc-update.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/0bf6f7cd.patch#/jc-fix-incorrect-variable-parsing-when-wildcard-schedul.patch to /home/tkloczko/rpmbuild/SOURCES/jc-fix-incorrect-variable-parsing-when-wildcard-schedul.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/240ed404.patch#/jc-Add-parser-for-the-bluetoothctl-utility.patch to /home/tkloczko/rpmbuild/SOURCES/jc-Add-parser-for-the-bluetoothctl-utility.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/f8dceb50.patch#/jc-Fix-minor-typo-in-documentation.patch to /home/tkloczko/rpmbuild/SOURCES/jc-Fix-minor-typo-in-documentation.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/08496533.patch#/jc-Process-data-only-if-data-is-given.patch to /home/tkloczko/rpmbuild/SOURCES/jc-Process-data-only-if-data-is-given.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/291b6b06.patch#/jc-Parse-numeric-fields-to-their-actual-numeric-value.patch to /home/tkloczko/rpmbuild/SOURCES/jc-Parse-numeric-fields-to-their-actual-numeric-value.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/9b7e3de3.patch#/jc-Fix-broken-unit-tests-for-the-bluetoothctl-parser.patch to /home/tkloczko/rpmbuild/SOURCES/jc-Fix-broken-unit-tests-for-the-bluetoothctl-parser.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/67164e7b.patch#/jc-fix-mypy-issues.patch to /home/tkloczko/rpmbuild/SOURCES/jc-fix-mypy-issues.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/fc48874a.patch#/jc-pytest-warning-fixes.patch to /home/tkloczko/rpmbuild/SOURCES/jc-pytest-warning-fixes.patch
warning: Downloading https://github.com/kellyjonbrazil/jc//commit/786dc76c.patch#/jc-fix-for-battery-not-charging-message.patch to /home/tkloczko/rpmbuild/SOURCES/jc-fix-for-battery-not-charging-message.patch
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.OgqWAv
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd /home/tkloczko/rpmbuild/BUILD
+ rm -rf jc-1.23.1
+ /usr/bin/gzip -dc /home/tkloczko/rpmbuild/SOURCES/jc-1.23.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd jc-1.23.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-Fix-iwconfig-re_interface-regex.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-fix-for-dashes-in-name.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-doc-update.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-fix-incorrect-variable-parsing-when-wildcard-schedul.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-Add-parser-for-the-bluetoothctl-utility.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-Fix-minor-typo-in-documentation.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-Process-data-only-if-data-is-given.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-Parse-numeric-fields-to-their-actual-numeric-value.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-Fix-broken-unit-tests-for-the-bluetoothctl-parser.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/jc-doc-update.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
1 out of 1 hunk FAILED -- saving rejects to file jc/lib.py.rej
1 out of 1 hunk FAILED -- saving rejects to file man/jc.1.rej
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej
Hi there - I'm not familiar with this build process. I'll have to look deeper into this.
This is not about build process. As you see duing build are downloaded patches from exact commit hashes. Are you sure that dev branch has been made on last version tag?
Ah, no I don't usually tag the dev
branch, only the master
branch. I can tag it if that helps?
Ah, no I don't usually tag the
dev
branch, only themaster
branch. I can tag it if that helps?
Ha .. so I should add master + dev commits. OK will try 😋
That's strange - I typically sync master
and dev
before I start working on dev
so you should be able to just add the dev
commits on top of the latest release. I'm not sure what could be causing that.
Maybe you are missing some commits? A PR shows there should be 16:
Commits on Mar 31, 2023 Fix iwconfig re_interface regex
Merge pull request https://github.com/kellyjonbrazil/jc/pull/384 from six3six/patch-1
Commits on Apr 2, 2023 fix for dashes in name
fix incorrect variable parsing when wildcard schedule
Commits on Apr 14, 2023 Add parser for the bluetoothctl utility
Commits on Apr 16, 2023 Fix minor typo in documentation
Process data only if data is given
Parse numeric fields to their actual numeric value
Fix broken unit tests for the bluetoothctl parser
Merge pull request https://github.com/kellyjonbrazil/jc/pull/392 from tzeikob/bluetoothctl-parser
Commits on Apr 17, 2023 pytest warning fixes
fix for battery not charging message
Commits on Apr 18, 2023 fix for multiline description
Released in v1.23.2
jJust tested new versiona d still I see one warning
===================================================================================== warnings summary ======================================================================================
jc/parsers/dir.py:1
/home/tkloczko/rpmbuild/BUILD/jc-1.23.2/jc/parsers/dir.py:1: DeprecationWarning: invalid escape sequence \>
"""jc - JSON Convert `dir` command output parser
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================= 1285 passed, 1 warning in 20.54s ==============================================================================
Yep, that's a false positive.
Hmm something still is wrong and I cannot figure out wha.
Whej I've build jc
on my devel system I was ble to generate bash completions file.
After sending the same source rom to builder where is isibstaleld only NuildRequires it fails like I;ve reported last time
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.2-2.fc35.x86_64/usr/bin/jc --bash-comp
jc: Error - Exit due to unexpected error:
NameError: name 'Name' is not defined
BTW pep517 build shows warning
/usr/lib/python3.8/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!
********************************************************************************
The license_file parameter is deprecated, use license_files instead.
By 2023-Oct-30, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
parsed = self.parsers.get(option_name, lambda x: x)(value)
Thanks, I updated setup.cfg
to use license_files
in the dev
branch. This will make it into the next release.
I was looking through the source code and really the only object with the name Name
is from the pygments library. Can you check to see if pygments in installed in the build environment? Also, if there is a way to run jc
with -dd
when doing the bash-completion step that might show more debug info.
Bingo! That was missing pygments
👍 😄
Have yet another small question: is it not would be better to mainatin jc bash-completion file as standalone file?
With that it would be possible to remove some jc code 🤔 (and probably remove pygments
dependency)
Nice! It's been a while so I can't remember the history but I believe the way the bash completions work was done for another packager a while back.
Do you mean the capability of auto-generating the completions with jc -B
or jc -Z
? Or do you just mean the completion files themselves being packaged with the source?
BTW - it looks like I use they python script to build the completions along with doc updates in updatedocs.sh
:
./build-completions.py
which is just:
#!/usr/bin/env python3
# build Bash and Zsh completion scripts and add to the completions folder
from jc.shell_completions import bash_completion, zsh_completion
with open('completions/jc_bash_completion.sh', 'w') as f:
print(bash_completion(), file=f)
with open('completions/jc_zsh_completion.sh', 'w') as f:
print(zsh_completion(), file=f)
I was not aware that jc
provides completion file for zsh as well 🤔 (I've done my jc.spec using fedora spec file as base ehre is generated only bash file).
Currenty bash and files are generated. IMO it would be better to keep that files as source. With that it would be possible to make taht file a bit shorter by replace every 4 spaces of indentation by tabs.
Yet another suggestion (/question).
Looks like jc
documentation consist out of some .md files. Do you have any plans to add docs/conf.py file to be able use those files to generate documentation using sphinx? (I'm packaging all pthon modules sphinx generated dicumentation as man pages).
With that it woud be possible publish thart as web content as well.
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output with warnings:
Here is list of installed modules in build env