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

"IndexError: list index out of range" on clean install. #209

Closed
AvinashReddy3108 opened this issue Jan 27, 2021 · 8 comments
Closed

"IndexError: list index out of range" on clean install. #209

AvinashReddy3108 opened this issue Jan 27, 2021 · 8 comments
Assignees
Milestone

Comments

@AvinashReddy3108
Copy link

Bug description

A clear and concise description of what the bug is.

it gives "IndexError: list index out of range" on a fresh install from PyPI

Modifications under .PyFunceble.yaml

N/A

A clear representation of what you changed.

Nothing at all, it's a fresh install from PyPI.

Reproduction

Steps to reproduce the behavior:

  1. pip install pyfunceble (or pyfunceble-dev)
  2. Run pyfunceble -h.
  3. See error

Expected behavior

A clear and concise description of what you expected to happen.

It should show help/syntax of using the PyFunceble CLI.

Screenshots/Error Log

If applicable, add screenshots to help explain your problem.

(_pyfunk) [avinash@rustbucket ~]$ pyfunceble -h

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Traceback (most recent call last):
  File "/home/avinash/_pyfunk/bin/pyfunceble", line 8, in <module>
    sys.exit(tool())
  File "/home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble/cli/__init__.py", line 1209, in tool
    raise exception
  File "/home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble/cli/__init__.py", line 1190, in tool
    PyFunceble.core.CLI.compare_version_and_print_messages()
  File "/home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble/core/cli.py", line 606, in compare_version_and_print_messages
    if cls.__check_deprecated(upstream_version):
  File "/home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble/core/cli.py", line 495, in __check_deprecated
    checked = PyFunceble.abstracts.Version.compare(version)
  File "/home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble/abstracts/package.py", line 172, in compare
    if int(version_number) < int(upstream[index]):
IndexError: list index out of range

Versions

OS: Arch Linux neofetch output included

avinash@rustbucket 
------------------ 
OS: Arch Linux x86_64 
Host: H81M-S 
Kernel: 5.10.7-111-tkg-bmq 
Uptime: 7 hours, 27 mins 
Packages: 1286 (pacman) 
Shell: bash 5.1.4 
Resolution: 1366x768 
DE: Plasma 5.20.5 
WM: KWin 
WM Theme: Materia-Dark 
Theme: Materia Dark [Plasma], Materia-dark-compact [GTK2/3] 
Icons: Papirus-Dark [Plasma], Papirus-Dark [GTK2/3] 
Terminal: yakuake 
CPU: Intel i3-4130 (4) @ 3.400GHz 
GPU: NVIDIA GeForce GT 1030 
GPU: Intel 4th Generation Core Processor Family 
Memory: 3032MiB / 5838MiB 

Python Version: 3.9.1
PyFunceble Version: pyfunceble 3.3.3.dev (Teal Blauwbok: Gander)

Additional context

  • For some reason, only pyfunceble -v seems to work for me.
  • Tried out the version from AUR too, gives the same error.
  • It does not matter if it is run in a virtualenv or not, the same error exists.
@spirillen
Copy link
Contributor

Pyfunceble v3.3.3.dev is known to have these issues, in fact all versions between 3.2.0 (stable) to 3.3.7-dev are troubled, however Pyfunceble 3.3.2 & 3.3.37-dev are both running stable under a virtual env like Conda #39

In case you have just been installing with python3.x -m pip install pyfunceble(-dev) you should clean your pip cache

you can also use the --no-cache parameter to ensure you are fetching straight from the Pypi servers

python3.9 install -U --no-cache -I --user pyfunceble-dev = pyfunceble v3.3.7-dev

python3.9 install -U --no-cache -I --user --pre pyfunceble-dev = pyfunceble v4.0.0b17. (as of time of writing this)

@funilrys funilrys self-assigned this Jan 27, 2021
@funilrys funilrys added the bug label Jan 27, 2021
@funilrys funilrys added this to the 3.x milestone Jan 27, 2021
@funilrys
Copy link
Owner

I don't like to touch that 3.x thing, but I'll write some retro compatibility patches so that it keeps working until 4.0.0 takes over.

@spirillen
Copy link
Contributor

spirillen commented Jan 27, 2021

I don't like to touch that 3.x thing, but I'll write some retro compatibility patches so that it keeps working until 4.0.0 takes over.

I will say it should be necessary to write more fixes for that, you can just merge the 3.3.7-dev into the stable, and then we make a notification about it probably will require a virtual environment like conde to be running as expected. Since the 3.3.7-dev is rather stable under Conda and python2 virtualenv /python3 venv

@funilrys
Copy link
Owner

@AvinashReddy3108, thank you for reporting. It's late here in Berlin Time, but the patch is into the dev branch as PyFunceble-dev==3.3.8.

I'll deploy to the stable later today as it is Midnight ++ here right now.

Time for me to sleep.

@spirillen
Copy link
Contributor

2 things I stumbled upon

  1. You have probably tried to use the pyfunceble -h to print the help, however, the -h is for switching the hosts files generation output on|off. You'll need to use the full length version --help
  2. The full command line to use for installing is:
    1. $ pip3 install -U --no-cache -I --user pyfunceble-dev==3.3.8 OR
    2. $ python3.9 -m pip install -U --no-cache -I --user pyfunceble-dev==3.3.8

@AvinashReddy3108
Copy link
Author

2 things I stumbled upon

1. You have probably tried to use the `pyfunceble -h` to print the help, however, the `-h` is for switching the hosts files generation output on|off. You'll need to use the full length version `--help`

2. The full command line to use for installing is:
   
   1. `$ pip3 install -U --no-cache -I --user pyfunceble-dev==3.3.8` OR
   2. `$ python3.9 -m pip install -U --no-cache -I --user pyfunceble-dev==3.3.8`

I removed all installed versions of PyFunceble from the virtualenv and installed the -dev 3.3.8

[avinash@rustbucket ~]$ source ~/_pyfunk/bin/activate

(_pyfunk) [avinash@rustbucket ~]$ pip cache
ERROR: Need an action (dir, info, list, purge, remove) to perform.

(_pyfunk) [avinash@rustbucket ~]$ pip cache purge
Files removed: 182

(_pyfunk) [avinash@rustbucket ~]$ pip uninstall pyfunceble-dev
Found existing installation: PyFunceble-dev 3.3.7
Uninstalling PyFunceble-dev-3.3.7:
  Would remove:
    /home/avinash/_pyfunk/bin/PyFunceble
    /home/avinash/_pyfunk/bin/pyfunceble
    /home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble/*
    /home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble_dev-3.3.7.dist-info/*
Proceed (y/n)? y
  Successfully uninstalled PyFunceble-dev-3.3.7

(_pyfunk) [avinash@rustbucket ~]$ pip uninstall pyfunceble
Found existing installation: PyFunceble 3.3.3
Uninstalling PyFunceble-3.3.3:
  Would remove:
    /home/avinash/_pyfunk/lib/python3.9/site-packages/PyFunceble-3.3.3.dist-info/*
    /home/avinash/_pyfunk/lib/python3.9/site-packages/tests/*
Proceed (y/n)? y
  Successfully uninstalled PyFunceble-3.3.3

(_pyfunk) [avinash@rustbucket ~]$ pip install --no-cache -I pyfunceble-dev==3.3.8
Collecting pyfunceble-dev==3.3.8
  Downloading PyFunceble_dev-3.3.8-py3-none-any.whl (270 kB)
     |████████████████████████████████| 270 kB 461 kB/s 
Collecting alembic
  Downloading alembic-1.5.2-py2.py3-none-any.whl (155 kB)
     |████████████████████████████████| 155 kB 3.7 MB/s 
Collecting dnspython>=2.0.0
  Downloading dnspython-2.1.0-py3-none-any.whl (241 kB)
     |████████████████████████████████| 241 kB 3.5 MB/s 
Collecting PyMySQL
  Downloading PyMySQL-1.0.2-py3-none-any.whl (43 kB)
     |████████████████████████████████| 43 kB 9.8 MB/s 
Collecting requests<3
  Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 6.8 MB/s 
Collecting inflection
  Downloading inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
Collecting sqlalchemy
  Downloading SQLAlchemy-1.3.22-cp39-cp39-manylinux2010_x86_64.whl (1.3 MB)
     |████████████████████████████████| 1.3 MB 5.7 MB/s 
Collecting setuptools
  Downloading setuptools-52.0.0-py3-none-any.whl (784 kB)
     |████████████████████████████████| 784 kB 10.7 MB/s 
Collecting python-dotenv
  Downloading python_dotenv-0.15.0-py2.py3-none-any.whl (18 kB)
Collecting domain2idna
  Downloading domain2idna-1.12.0-py3-none-any.whl (10 kB)
Collecting cryptography
  Downloading cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl (2.6 MB)
     |████████████████████████████████| 2.6 MB 11.3 MB/s 
Collecting python-box[all]>=5.0.0
  Downloading python_box-5.2.0-py3-none-any.whl (20 kB)
Collecting PyYAML
  Downloading PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl (630 kB)
     |████████████████████████████████| 630 kB 12.0 MB/s 
Collecting colorama
  Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting toml
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting ruamel.yaml
  Downloading ruamel.yaml-0.16.12-py2.py3-none-any.whl (111 kB)
     |████████████████████████████████| 111 kB 9.7 MB/s 
Collecting msgpack
  Downloading msgpack-1.0.2-cp39-cp39-manylinux1_x86_64.whl (294 kB)
     |████████████████████████████████| 294 kB 10.5 MB/s 
Collecting chardet<5,>=3.0.2
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     |████████████████████████████████| 178 kB 11.8 MB/s 
Collecting idna<3,>=2.5
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 14.0 MB/s 
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.3-py2.py3-none-any.whl (137 kB)
     |████████████████████████████████| 137 kB 11.7 MB/s 
Collecting certifi>=2017.4.17
  Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 11.1 MB/s 
Collecting python-dateutil
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |████████████████████████████████| 227 kB 10.3 MB/s 
Collecting python-editor>=0.3
  Downloading python_editor-1.0.4-py3-none-any.whl (4.9 kB)
Collecting Mako
  Downloading Mako-1.1.4.tar.gz (479 kB)
     |████████████████████████████████| 479 kB 10.8 MB/s 
Collecting six>=1.4.1
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting cffi>=1.12
  Downloading cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl (405 kB)
     |████████████████████████████████| 405 kB 11.8 MB/s 
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 10.8 MB/s 
Collecting MarkupSafe>=0.9.2
  Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Building wheels for collected packages: Mako, MarkupSafe
  Building wheel for Mako (setup.py) ... done
  Created wheel for Mako: filename=Mako-1.1.4-py2.py3-none-any.whl size=75675 sha256=98100c01862fa1e07d97995a226d58fbd5e48e5845b8a34110b49f5c57e004c4
  Stored in directory: /tmp/pip-ephem-wheel-cache-qfa1lmxv/wheels/cd/56/62/f7e8f1528d26bbdd5d1ea7693b945b4cbef4bbaa0db0bea2b0
  Building wheel for MarkupSafe (setup.py) ... done
  Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-cp39-cp39-linux_x86_64.whl size=27375 sha256=49465f10e5c2337aa5e3b9f8fb1b51848dd14d5c88728b1852eb8651fe849529
  Stored in directory: /tmp/pip-ephem-wheel-cache-qfa1lmxv/wheels/e0/19/6f/6ba857621f50dc08e084312746ed3ebc14211ba30037d5e44e
Successfully built Mako MarkupSafe
Installing collected packages: six, pycparser, MarkupSafe, urllib3, toml, sqlalchemy, setuptools, ruamel.yaml, python-editor, python-dateutil, python-box, msgpack, Mako, idna, colorama, chardet, cffi, certifi, requests, PyYAML, python-dotenv, PyMySQL, inflection, domain2idna, dnspython, cryptography, alembic, pyfunceble-dev
Successfully installed Mako-1.1.4 MarkupSafe-1.1.1 PyMySQL-1.0.2 PyYAML-5.4.1 alembic-1.5.2 certifi-2020.12.5 cffi-1.14.4 chardet-4.0.0 colorama-0.4.4 cryptography-3.3.1 dnspython-2.1.0 domain2idna-1.12.0 idna-2.10 inflection-0.5.1 msgpack-1.0.2 pycparser-2.20 pyfunceble-dev-3.3.8 python-box-5.2.0 python-dateutil-2.8.1 python-dotenv-0.15.0 python-editor-1.0.4 requests-2.25.1 ruamel.yaml-0.16.12 setuptools-52.0.0 six-1.15.0 sqlalchemy-1.3.22 toml-0.10.2 urllib3-1.26.3

(_pyfunk) [avinash@rustbucket ~]$ pyfunceble

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Your current version is considered as deprecated.
Please take the time to update PyFunceble!

🎉🌠 Happy New Year! 🌠🎉
Best wishes to you and your beloved ones.

Nothing to test.
(_pyfunk) [avinash@rustbucket ~]$

Is it OK that it asks me to update it, on a -dev branch?

Your current version is considered as deprecated.
Please take the time to update PyFunceble!

@spirillen
Copy link
Contributor

spirillen commented Jan 28, 2021

Hi @AvinashReddy3108 about the:

Your current version is considered as deprecated.
Please take the time to update PyFunceble!

I'll say it's OK, with the consideration, that we do not plan to tush the code any further. On the other hand, you are right it's a bit early in the light of the 4.0.0 is still in beta.

My personal opinion is I'm OK with this as the 4.0.0.b17 is stable enough for most use cases.

Here is a couple of examples of running PyFuncebles: https://github.com/dns-test/rpz.mypdns.cloud, https://github.com/dns-test/porn.host.rpz & Ultimate Hosts Blacklist had it running until GHA disabled it.
When this is said, I also for sure hope @funilrys it getting back to the keyboard and fixes the open issues we have.

Depending on which test's you are consider to use I might as well hope you would upgrade to 4.0.0-beta and then report any failures you might find.

Best wishes and thanks again for your feedback and let it never be the last one 😃
@spirillen

funilrys added a commit that referenced this issue Jan 28, 2021
The part with the code comparison come directly from 4.0.0b18.

This patch fixes the last issue in #209.

Indeed, it doesn't make sense to say that the version is deprecated when
the upstream version is still in beta.

Contributors:
  * @AvinashReddy3108
  * @spirillen
@funilrys
Copy link
Owner

Hi @spirillen @AvinashReddy3108,

You are right. A beta version shouldn't mark the currently installed version as deprecated.

It should be fixed with the next 3.x-dev version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants