Comments (9)
After a proper look at the code, CircUp already has this feature for normal releases.
It would be nice to be notified of newer beta versions, but after reading github documentation the only redirecting url seems to be github.../releases/latest which links to the current non-beta release.
Without parsing the github..circuitpython/releases (or maybe github..circuitpython/tags) page, I can't see an easy way to extract the information.
I'll leave this open in case someone can figure an easy way to get the latest beta/rc release version. Otherwise, I'll close it in a week or so.
from circup.
The list of releases if available from: https://api.github.com/repos/adafruit/circuitpython/releases
A non stable relase is one where "-" in release['tag_name']
(that's the test circuitpython itself does to identify un/stable releases in the download pages of circuitpython.org)
import json
import requests
response = requests.get("https://api.github.com/repos/adafruit/circuitpython/releases")
data = response.json()
betas = [
release['tag_name']
for release in data
if "-" in release['tag_name']
]
print(betas[0])
6.2.0-beta.4
Of course there is potential rate limiting issues with the API, but we don't need to hit it more than once a day, and can safely ignore an error.
from circup.
betas = [ release['tag_name'] for release in data if "-" in release['tag_name'] ]
could be improved to
betas = [ release['tag_name'] for release in data if release['prerelease'] ]
We could also do something with git command line like
git ls-remote --tags --refs https://github.com/adafruit/circuitpython
This currently downloads ~11k compared to ~100k for the webpage. It also gives all tags but they would need to be version parsed and sorted.
from circup.
Thanks @lesamouraipourpre for going back and verifying that indeed circup does have this already.
It might be worth adding the downloads link into the existing new version notification.
https://circuitpython.org/downloads
https://github.com/adafruit/circup/blob/master/circup.py#L819
As for discovering and encouraging beta usage, for the general population of CP folks (beginners) I wouldn't push for that. It's also not how python packaging\pip works. You pip install from the releases and you go to the repo\website for non-released versions. I think we're trying to mostly mimic that behavior here (although we use "list" in non pip-like fashion).
from circup.
We could do something like the following pseudo-code which for most CircUp users would do nothing different. But for users who currently have a prerelease version installed it will run extra version checks.
if current_version < latest_stable_version:
display update message
if current_version is a prerelease version:
get latest release versions
if current_version < latest_prerelease_version_with_same_major:
display update message
if current_version_major < maximum_prerelease_major:
display information about a new version being developed
For example (with made up version numbers):
Example A - stable user:
Current Version : 6.0.2
There is a newer version of CircuitPython available: 6.1.0
Example B - testing user:
Current Version : 6.0.1-beta.2
There is a newer version of CircuitPython available: 6.1.0
There is a newer prerelease version of CircuitPython available: 6.2.0-rc.4
There is a future version of CircuitPython being developed: 7.0.0-alpha.2
from circup.
As an aside, version 6 is currently hard-coded into the script:
def get_bundle(tag):
urls = {
"py": (
"https://github.com/adafruit/Adafruit_CircuitPython_Bundle"
"/releases/download"
"/{tag}/adafruit-circuitpython-bundle-py-{tag}.zip".format(tag=tag)
),
"6mpy": (
"https://github.com/adafruit/Adafruit_CircuitPython_Bundle/"
"releases/download"
"/{tag}/adafruit-circuitpython-bundle-6.x-mpy-{tag}.zip".format(tag=tag)
),
}
Is this an intentional behaviour that is planned for in the transition to CP7? Or should I raise an issue about it?
from circup.
It used to have both 5 and 6 listed so I think you're correct it is intentional and where one could add 7 and the community bundle.
If there's a better way I know everyone appreciates PRs. :)
from circup.
Oh, by the way, there is now a JSON file attached to the Bundle releases that includes all the libraries, versions, and dependencies (as well as paths in the bundle itself). I'm working on an API that will allow you to query all this information as well to facilitate plugin development and make things easier that makes use of the JSON file.
from circup.
I'm closing this as the upcoming work to be done on moving to JSON dependency management should hopefully cover most cases.
from circup.
Related Issues (20)
- Library gets updated even if update not needed. HOT 17
- can't install 1.2.3 HOT 12
- --help output in the readme is outdated
- circup fails to find bundle? HOT 3
- Feature Request: Option to use a release tag other than 'latest' HOT 1
- Can't handle UTF-8 in Windows 11 Home HOT 4
- Find out which bundles are available automatically
- Does not work with Blinka HOT 1
- How are dependencies with Community Bundle libraries listed in requirements.txt? HOT 5
- Support for CircuitPython 9 HOT 1
- There was a problem downloading the bundle. Please try again in a moment HOT 4
- Fail to remove build-in bundle (to bypass infra issue) HOT 3
- Clean up circup requirements; update base Python version; switch to pyproject.toml? HOT 1
- Report weekly usage stats
- `toml` not installed with `pip install circup==1.5.0` HOT 2
- `semver` package breaking change: `isvalid()` -> `is_valid()` HOT 2
- Documentation for PyProject.toml HOT 4
- All lib foo.mpy files updated each use of circup with 9.0.0 alpha 5 and 6 HOT 2
- Can't get help for install if no device detected HOT 1
- PyPi Library Name Resolution Differes from Learn Bundler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circup.