deadc0de6 / dotdrop

Save your dotfiles once, deploy them everywhere
https://dotdrop.readthedocs.io
GNU General Public License v3.0
1.77k stars 105 forks source link

toml: move from toml to tomllib + tomli_w #395

Closed parona-source closed 1 year ago

parona-source commented 1 year ago

https://fedoraproject.org/wiki/Changes/DeprecatePythonToml https://bugs.gentoo.org/878651

Ran the full test-ng test suite in Ubuntu container with python3.8 as its failing on my host machine for unrelated reasons in current HEAD. Haven't looked further on that. Pytest and toml.sh pass just fine.

Arch appears to be on python3.11 so it should just need tomli-w.

parona-source commented 1 year ago
************* Module yaml_to_toml
scripts/yaml_to_toml.py:55:4: C0103: Constant name "out" doesn't conform to UPPER_CASE naming style (invalid-name)

I'm unsure how my change triggered this.

deadc0de6 commented 1 year ago

Oh very cool, thanks a lot for this!

I'm also surprised by the pylint error since I have other actions using the same pylint/python version that did not raise that linting error. It seems it has been raised already, see https://github.com/pylint-dev/pylint/issues/3132.

I added pylint comments in https://github.com/deadc0de6/dotdrop/commit/84bdd80be059eed2320f0cfc089740635617ec3e what should hopefully bypass those linting errors. Could you rebase?

parona-source commented 1 year ago
ask@bigglane /home/ask/sources/test
 $ cat t.py 
'''
cool
'''
import tomli_w

if __name__ == '__main__':
    out = tomli_w.dumps("")
    print(out)
ask@bigglane /home/ask/sources/test
 $ pylint t.py
************* Module t
t.py:7:4: C0103: Constant name "out" doesn't conform to UPPER_CASE naming style (invalid-name)

------------------------------------------------------------------
Your code has been rated at 7.50/10 (previous run: 7.50/10, +0.00)

ask@bigglane /home/ask/sources/test
 $ cat t1.py 
'''
cool
'''
import toml

if __name__ == '__main__':
    out = toml.dumps("test")
    print(out)
ask@bigglane /home/ask/sources/test
 $ pylint t1.py

-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 8.75/10, +1.25)

Something with tomli_w is cursed :P

coveralls commented 1 year ago

Coverage Status

coverage: 91.052% (+0.003%) from 91.049% when pulling 91daad5f615667270f17ecd0a4cfae00d37cf9c7 on parona-source:toml into 84bdd80be059eed2320f0cfc089740635617ec3e on deadc0de6:master.

parona-source commented 1 year ago

Ran the full test-ng test suite in Ubuntu container with python3.8 as its failing on my host machine for unrelated reasons in current HEAD.

On an unrelated note ive gotten to minimize the issue with tests-ng/import-with-trans.s to the gnupg version. Something with behaviour changed between 2.2.41 and 2.4.2 which causes it to fail. Haven't further time on this. But if you update the ci container at some point in the future, it may then become an issue.

deadc0de6 commented 1 year ago

Thanks. I have opened an issue at pylint with your example: https://github.com/pylint-dev/pylint/issues/8930.

deadc0de6 commented 1 year ago

Ran the full test-ng test suite in Ubuntu container with python3.8 as its failing on my host machine for unrelated reasons in current HEAD.

On an unrelated note ive gotten to minimize the issue with tests-ng/import-with-trans.s to the gnupg version. Something with behaviour changed between 2.2.41 and 2.4.2 which causes it to fail. Haven't further time on this. But if you update the ci container at some point in the future, it may then become an issue.

Thanks, good point, I'll move away from gpg to avoid any bad surprise

deadc0de6 commented 1 year ago

@parona-source thanks again for your help on this! I'll release a new version ASAP.