Vendor Textual#893
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
==========================================
+ Coverage 92.44% 92.45% +0.01%
==========================================
Files 99 98 -1
Lines 11726 11720 -6
Branches 426 423 -3
==========================================
- Hits 10840 10836 -4
+ Misses 886 884 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
See changelog for more details. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net> Signed-off-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Use `vendoring` as a development dependency. Signed-off-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Vendor the Textual 8.2.1 source tree to ensure it doesn't break memray when new releases change the API. Signed-off-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Rewrite reporter and test imports to the vendored Textual namespace and update dependencies. With this we can also remove the shims we required for maintaining version compatibility. This also adds two checks to validate vendoring: a pre-commit hook to block textual imports outside the vendored tree, and a CI check to ensure consistency across the vendored versions. Since we're pulling in the latest Textual version which requires Python 3.9, this also requires bumping our minimum Python version. Signed-off-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
|
Ugh, I didn't think about the fact that we've been using different Textual versions on different Python versions, and this'll force us to use the same one across all of them. Blah. |
|
OK. I think I'm comfortable dropping support for 3.7 and 3.8. Doing it because we're vendoring Textual feels stupid, but I can live with it... If we get pushback from users, one option might be to re-add support for 3.8 but make it so that it doesn't use the vendored copy, and instead has a dependency on Textual and uses the last version to support 3.8. It's only a little bit more work (updating all of our imports to be conditional based on @pablogsal Any objections to dropping 3.7 and 3.8 support? |
|
Out of curiosity I ran a query on the PyPI BigQuery dataset to see the version distribution for the past 30 days: Looks like 3.7 and 3.8 are barely used. Here is the query for reference WITH counts AS (
SELECT
REGEXP_EXTRACT(details.python, r'^\d+\.\d+') AS python_minor,
COUNT(*) AS downloads
FROM `bigquery-public-data.pypi.file_downloads`
WHERE file.project = 'memray'
AND DATE(timestamp) >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
AND details.python IS NOT NULL
GROUP BY python_minor
)
SELECT
python_minor,
downloads,
ROUND(downloads * 100.0 / SUM(downloads) OVER (), 2) AS pct
FROM counts
WHERE python_minor IS NOT NULL
ORDER BY downloads DESC |
My concern is that big corporations are likely to continue using Python versions well past their end of life. Those big corporations will tend to be using PyPI mirrors, so I believe the entire company appears as only one download in the BigQuery dataset rather than thousands, if I understand how that data is gathered. Even considering that I'm sure that the two older versions are our least used, but I do think that the BigQuery dataset likely underrepresents them. |
|
No objections from me: drop 3.7 and 3.8. The PyPI data speaks for itself, and honestly those versions are so far past EOL that it's hard to justify the maintenance burden. Let's move on. 🚀 |
Since this vendors the latest version of Textual which needs Python 3.9, this also drops support for 3.7 and 3.8 in Memray. If you think we should keep compatibility with those, we can downgrade Textual instead.