-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
WEB: Better management of releases in the pandas home page #50885
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
Comments
take |
So the function didn't actually do any sorting in it, however, in order to group versions together to find the max version, sorting is required. The sorting is done by parsing the version ("tag_name" in the code) using version.parse and sorting it. I also made it so that the obsolete versions do not make it into the context map. The output now looks as follows:
I'm not too sure about properly testing the code, though. Is it possible for you to explain further please? What sort of tests should the file run? This is also might be a very silly question, but I'm having difficulty running a test file that prints the outputs in anywhere but where pandas_web.py is located. I tried using sys.path.insert, but then it was having difficulty locating the config.yml file. Also, I'm not sure whether this is fine or not, but in order to make my test context work, I had to add this line manually:
This is done normally in the pandas_web.py file by default in the if name == "main" section, so I had to manually add it in myself or I would get an error |
Thanks @JustinAmstadt, this looks great. Feel free to open a pull request with what you have, even if it's giving you problems. It may be easier to comment directly on the code. If you use pytest, afaik the root directory being tested is added to the python path. So, when doing Does this answer your questions? As said, feel free to open a PR, and add yourself comments with the questions in the code, if that makes things easier. |
Hey I am new to open source development, is there any way I can contribute to this repo ? |
Hi @NamanMohnani |
take |
In the pandas home page we show the released versions, both in the
Latest version
box, and thePrevious versions
list.Obtaining the releases is done here. So far, the function is pretty simple, just sorting the releases by date, and assuming the last one by date it's the latest.
While this makes sense, we're planning to release 2.0 shortly, and it's likely that we release 1.5.4 after it. With the current implementation and after those releases, we'd list 1.5.4 as the latest release, which is not great since we expect users to use 2.0, which is not the latest by date, but the newest in terms of features.
The idea is to improve the current implementation to be smarter, and not use the date, but use the version number. This can be done with version.parse.
Since we are implementing this, I think besides detecting the latest version, it can make sense to also filter obsolete versions from the long list of releases. For example, 1.5.3 is the same version as 1.5.2, 1.5.1 and 1.5.0 but with bugs fixed. There is no reason a user would want to install any 1.5 version except the last one. 1.4.4 is a reasonable version, since users may have code using that version that they didn't migrate yet to be compatible with 1.5. But 1.4.3, 1.4.2, 1.4.1 and 1.4.0 shouldn't be used, so probably better to not have them in the list.
I don't think we have any tests for the script that generates the website. But since the new implementation is not trivial, it'd be good to have it tested. Maybe just a
tests/test_pandas_web.py
in the same directory as the script, and calling pytest on that directory in the documentation build is the best option.The text was updated successfully, but these errors were encountered: