kellyjonbrazil / jc

CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.
MIT License
7.79k stars 196 forks source link

1.23.1: pytest warnings #390

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

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.

Here is pytest output with warnings:

```console + SETUPTOOLS_SCM_PRETEND_VERSION=1.23.1 + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/jc-1.23.1-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.3.0, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/jc-1.23.1 collected 1267 items tests/test_acpi.py ....... [ 0%] tests/test_airport.py .. [ 0%] tests/test_airport_s.py .. [ 0%] tests/test_arp.py ............. [ 1%] tests/test_asciitable.py ........... [ 2%] tests/test_asciitable_m.py ........... [ 3%] tests/test_blkid.py ........... [ 4%] tests/test_cbt.py ..... [ 4%] tests/test_cef.py .. [ 5%] tests/test_cef_s.py .. [ 5%] tests/test_chage.py .. [ 5%] tests/test_cksum.py ..... [ 5%] tests/test_clf.py .. [ 5%] tests/test_clf_s.py .. [ 6%] tests/test_crontab.py ... [ 6%] tests/test_crontab_u.py ..... [ 6%] tests/test_csv.py ............ [ 7%] tests/test_csv_s.py ............. [ 8%] tests/test_date.py ...... [ 9%] tests/test_datetime_iso.py ...... [ 9%] tests/test_df.py ........... [ 10%] tests/test_dig.py ........................ [ 12%] tests/test_dir.py ......... [ 13%] tests/test_dmidecode.py .... [ 13%] tests/test_dpkg_l.py .... [ 13%] tests/test_du.py ..... [ 14%] tests/test_email_address.py ... [ 14%] tests/test_env.py ... [ 14%] tests/test_file.py ...... [ 15%] tests/test_findmnt.py .... [ 15%] tests/test_finger.py .... [ 15%] tests/test_free.py ....... [ 16%] tests/test_fstab.py ... [ 16%] tests/test_git_log.py .................... [ 18%] tests/test_git_log_s.py ....................... [ 19%] tests/test_git_ls_remote.py ... [ 20%] tests/test_gpg.py .. [ 20%] tests/test_group.py .... [ 20%] tests/test_gshadow.py ... [ 20%] tests/test_hash.py .. [ 20%] tests/test_hashsum.py ...... [ 21%] tests/test_hciconfig.py ..... [ 21%] tests/test_history.py ... [ 22%] tests/test_hosts.py ... [ 22%] tests/test_id.py ..... [ 22%] tests/test_ifconfig.py ............ [ 23%] tests/test_ini.py ....... [ 24%] tests/test_ini_dup.py ....... [ 24%] tests/test_iostat.py ............... [ 25%] tests/test_iostat_s.py ................ [ 27%] tests/test_ip_address.py ............ [ 28%] tests/test_iptables.py ............. [ 29%] tests/test_iso_datetime.py ...... [ 29%] tests/test_iw_scan.py ... [ 29%] tests/test_iwconfig.py .... [ 30%] tests/test_jar_manifest.py ... [ 30%] tests/test_jc.py ....... [ 31%] tests/test_jc_cli.py .................. [ 32%] tests/test_jc_lib.py ................... [ 33%] tests/test_jc_streaming.py ......... [ 34%] tests/test_jc_utils.py ........ [ 35%] tests/test_jobs.py ... [ 35%] tests/test_jwt.py .. [ 35%] tests/test_kv.py ...... [ 36%] tests/test_last.py ............. [ 37%] tests/test_ls.py .................................... [ 40%] tests/test_ls_s.py ............. [ 41%] tests/test_lsblk.py ..... [ 41%] tests/test_lsmod.py ... [ 41%] tests/test_lsof.py ..... [ 42%] tests/test_lspci.py .... [ 42%] tests/test_lsusb.py ........... [ 43%] tests/test_m3u.py ... [ 43%] tests/test_mdadm.py ......................................... [ 46%] tests/test_mount.py ...... [ 47%] tests/test_mpstat.py ..... [ 47%] tests/test_mpstat_s.py ..... [ 47%] tests/test_netstat.py .................................... [ 50%] tests/test_nmcli.py ............... [ 52%] tests/test_ntpq.py ....... [ 52%] tests/test_openvpn.py .. [ 52%] tests/test_os_prober.py ..... [ 53%] tests/test_passwd.py .... [ 53%] tests/test_pci_ids.py .. [ 53%] tests/test_pgpass.py .. [ 53%] tests/test_pidstat.py ..... [ 54%] tests/test_pidstat_s.py ..... [ 54%] tests/test_ping.py ................................................................. [ 59%] tests/test_ping_s.py .................................................................. [ 64%] tests/test_pip_list.py ...... [ 65%] tests/test_pip_show.py ...... [ 65%] tests/test_plist.py ....... [ 66%] tests/test_postconf.py .. [ 66%] tests/test_proc.py .. [ 66%] tests/test_proc_buddyinfo.py .. [ 66%] tests/test_proc_consoles.py ... [ 67%] tests/test_proc_cpuinfo.py ... [ 67%] tests/test_proc_crypto.py .. [ 67%] tests/test_proc_devices.py .. [ 67%] tests/test_proc_diskstats.py .. [ 67%] tests/test_proc_driver_rtc.py .. [ 67%] tests/test_proc_filesystems.py .. [ 68%] tests/test_proc_interrupts.py .. [ 68%] tests/test_proc_iomem.py .. [ 68%] tests/test_proc_ioports.py .. [ 68%] tests/test_proc_loadavg.py .. [ 68%] tests/test_proc_locks.py .. [ 68%] tests/test_proc_meminfo.py .. [ 69%] tests/test_proc_modules.py .. [ 69%] tests/test_proc_mtrr.py .. [ 69%] tests/test_proc_net_arp.py .. [ 69%] tests/test_proc_net_dev.py .. [ 69%] tests/test_proc_net_dev_mcast.py .. [ 69%] tests/test_proc_net_if_inet6.py .. [ 70%] tests/test_proc_net_igmp.py ... [ 70%] tests/test_proc_net_igmp6.py .. [ 70%] tests/test_proc_net_ipv6_route.py .. [ 70%] tests/test_proc_net_netlink.py .. [ 70%] tests/test_proc_net_netstat.py .. [ 70%] tests/test_proc_net_packet.py .. [ 71%] tests/test_proc_net_protocols.py .. [ 71%] tests/test_proc_net_route.py .. [ 71%] tests/test_proc_net_unix.py .. [ 71%] tests/test_proc_pagetypeinfo.py .. [ 71%] tests/test_proc_partitions.py .. [ 71%] tests/test_proc_pid_fdinfo.py ....... [ 72%] tests/test_proc_pid_io.py .. [ 72%] tests/test_proc_pid_maps.py .. [ 72%] tests/test_proc_pid_mountinfo.py .. [ 72%] tests/test_proc_pid_numa_maps.py .. [ 73%] tests/test_proc_pid_smaps.py .. [ 73%] tests/test_proc_pid_stat.py .... [ 73%] tests/test_proc_pid_statm.py .. [ 73%] tests/test_proc_pid_status.py .. [ 73%] tests/test_proc_slabinfo.py .. [ 73%] tests/test_proc_softirqs.py .. [ 74%] tests/test_proc_stat.py ... [ 74%] tests/test_proc_swaps.py .. [ 74%] tests/test_proc_uptime.py .. [ 74%] tests/test_proc_version.py .... [ 74%] tests/test_proc_vmallocinfo.py .. [ 75%] tests/test_proc_vmstat.py .. [ 75%] tests/test_proc_zoneinfo.py ... [ 75%] tests/test_ps.py ......... [ 76%] tests/test_route.py ........ [ 76%] tests/test_rpm_qai.py ... [ 77%] tests/test_rsync.py ............. [ 78%] tests/test_rsync_s.py ............. [ 79%] tests/test_semver.py ... [ 79%] tests/test_sfdisk.py ............... [ 80%] tests/test_shadow.py ... [ 80%] tests/test_ss.py ... [ 81%] tests/test_ssh_conf.py ...... [ 81%] tests/test_sshd_conf.py .... [ 81%] tests/test_stat.py ...... [ 82%] tests/test_stat_s.py ....... [ 82%] tests/test_sysctl.py ..... [ 83%] tests/test_syslog.py .. [ 83%] tests/test_syslog_bsd.py .. [ 83%] tests/test_syslog_bsd_s.py .. [ 83%] tests/test_syslog_s.py .. [ 83%] tests/test_systemctl.py ... [ 84%] tests/test_systemctl_lj.py .. [ 84%] tests/test_systemctl_ls.py ... [ 84%] tests/test_systemctl_luf.py ... [ 84%] tests/test_systeminfo.py . [ 84%] tests/test_time.py ......... [ 85%] tests/test_timedatectl.py ..... [ 85%] tests/test_timestamp.py ... [ 86%] tests/test_toml.py ... [ 86%] tests/test_top.py ...... [ 86%] tests/test_top_s.py ....... [ 87%] tests/test_tracepath.py ... [ 87%] tests/test_traceroute.py ...................... [ 89%] tests/test_udevadm.py .. [ 89%] tests/test_ufw.py ....... [ 90%] tests/test_ufw_appinfo.py ...... [ 90%] tests/test_uname.py ............ [ 91%] tests/test_update_alt_gs.py .. [ 91%] tests/test_update_alt_q.py ... [ 91%] tests/test_upower.py ....... [ 92%] tests/test_uptime.py ..... [ 92%] tests/test_url.py ............. [ 93%] tests/test_ver.py ... [ 94%] tests/test_vmstat.py ......... [ 94%] tests/test_vmstat_s.py .......... [ 95%] tests/test_w.py ...... [ 96%] tests/test_wc.py .... [ 96%] tests/test_who.py ....... [ 97%] tests/test_x509_cert.py ...... [ 97%] tests/test_xml.py ...... [ 97%] tests/test_xrandr.py .......... [ 98%] tests/test_yaml.py .... [ 99%] tests/test_zipinfo.py .... [ 99%] tests/test_zpool_iostat.py ... [ 99%] tests/test_zpool_status.py ..... [100%] ===================================================================================== warnings summary ====================================================================================== 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 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 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): -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ============================================================================= 1267 passed, 3 warnings in 13.95s ============================================================================= ```

Here is list of installed modules in build env

```console Package Version ---------------- ------- build 0.10.0 distro 1.8.0 exceptiongroup 1.0.0 gpg 1.19.0 iniconfig 2.0.0 installer 0.7.0 libcomps 0.1.19 packaging 23.0 pluggy 1.0.0 pyproject_hooks 1.0.0 pytest 7.3.0 python-dateutil 2.8.2 ruamel.yaml 0.17.21 ruamel.yaml.clib 0.2.6 setuptools 67.6.1 six 1.16.0 tomli 2.0.1 wheel 0.40.0 xmltodict 0.12.0 ```
kellyjonbrazil commented 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.

kellyjonbrazil commented 1 year ago

I think I have these fixed. Could you try from the dev branch? Thanks!

kloczek commented 1 year ago

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).

kloczek commented 1 year ago

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
kellyjonbrazil commented 1 year ago

Hi there - I'm not familiar with this build process. I'll have to look deeper into this.

kloczek commented 1 year ago

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?

kellyjonbrazil commented 1 year ago

Ah, no I don't usually tag the dev branch, only the master branch. I can tag it if that helps?

kloczek commented 1 year ago

Ah, no I don't usually tag the dev branch, only the master branch. I can tag it if that helps?

Ha .. so I should add master + dev commits. OK will try 😋

kellyjonbrazil commented 1 year ago

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

doc update

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

doc update

fix mypy issues

Commits on Apr 17, 2023 pytest warning fixes

fix for battery not charging message

Commits on Apr 18, 2023 fix for multiline description

kellyjonbrazil commented 1 year ago

Released in v1.23.2

kloczek commented 1 year ago

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 ==============================================================================
kellyjonbrazil commented 1 year ago

Yep, that's a false positive.

kloczek commented 1 year ago

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)
kellyjonbrazil commented 1 year ago

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.

kloczek commented 1 year ago

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)

kellyjonbrazil commented 1 year ago

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?

kellyjonbrazil commented 1 year ago

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)
kloczek commented 1 year ago

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.