Skip to content

Conversation

tenJirka
Copy link

reGenda is agenda app for reMarkable tablet

It is written in Python and uses wrapper around SAS. Can connect to caldav server and show events from there. (read only for now). For more info check my repo.

I'm author of the package and I tested it on reMarkable 2 but I hope it should work on reMarkable 1 too.

@Eeems
Copy link
Member

Eeems commented Aug 23, 2023

I did a quick pass to restructure the package with the following:

  • Removed display from depends and instead used the patch_rmfb flag
  • Moved all filesystem layout related stuff from configure() to package()
  • Removed all the extra mkdir calls as they are not needed when using install
  • Simplified the install statements that don't rename the file

@raisjn
Copy link
Contributor

raisjn commented Aug 24, 2023

just want to comment and say: cool app!!

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

just want to comment and say: cool app!!

Oh yeah, ditto

@tenJirka tenJirka requested a review from Eeems August 24, 2023 15:49
Python modules and reGenda scripts will be installed to
/opt/user/lib/reGenda

User interaction was removed and only warning will be displayed.

Added postremove function because lot of empy directories were left
over.
@tenJirka
Copy link
Author

I've added postremove function because a lot of empty directories were left over after uninstall in /opt/usr/lib/reGenda.

@tenJirka tenJirka requested a review from Eeems August 24, 2023 19:02
@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

I've added postremove function because a lot of empty directories were left over after uninstall in /opt/usr/lib/reGenda.

This shouldn't be the case unless runtime is creating files? That said, blanked removing the directory could remove user created files, which is not something we want to do. Empty folders being left behind is not as large of a concern.

@tenJirka
Copy link
Author

I've added postremove function because a lot of empty directories were left over after uninstall in /opt/usr/lib/reGenda.

This shouldn't be the case unless runtime is creating files? That said, blanked removing the directory could remove user created files, which is not something we want to do. Empty folders being left behind is not as large of a concern.

Some pycache files should be only created files by runtime. I don't know how bad it would be if they they will last.

root@reMarkable:/opt/usr/lib/reGenda# find . -name "*.pyc"
./__pycache__/languages.cpython-311.pyc
./__pycache__/calendar_caldav.cpython-311.pyc
root@reMarkable:/opt/usr/lib/reGenda# ls -lh __pycache__/
-rw-r--r--    1 root     root        3.7K Aug 24 19:18 calendar_caldav.cpython-311.pyc
-rw-r--r--    1 root     root        2.4K Aug 24 19:18 languages.cpython-311.pyc

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

I've added postremove function because a lot of empty directories were left over after uninstall in /opt/usr/lib/reGenda.

This shouldn't be the case unless runtime is creating files? That said, blanked removing the directory could remove user created files, which is not something we want to do. Empty folders being left behind is not as large of a concern.

Some pycache files should be only created files by runtime. I don't know how bad it would be if they they will last.

root@reMarkable:/opt/usr/lib/reGenda# find . -name "*.pyc"
./__pycache__/languages.cpython-311.pyc
./__pycache__/calendar_caldav.cpython-311.pyc
root@reMarkable:/opt/usr/lib/reGenda# ls -lh __pycache__/
-rw-r--r--    1 root     root        3.7K Aug 24 19:18 calendar_caldav.cpython-311.pyc
-rw-r--r--    1 root     root        2.4K Aug 24 19:18 languages.cpython-311.pyc

It might be best to target those folders and files explicitly then instead of a blanket delete. Ideally, we could generate them as part of the package process and include them, but we don't really have the build process setup for that yet, as they can only be created on the same architecture.

rm -f /opt/usr/lib/reGenda/**/*.cpython-*.pyc

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

I took a look at what entware distributes for their python packages, they just distribute the pyc files instead of the source. So they don't have to do any magic cleanup. We'll have to sort out a way to generate them for python packages in the future. I'm fine with just removing the generated pyc files as part of cleanup for now in this package.

@tenJirka
Copy link
Author

*.cpython-*.pyc

I've added postremove function because a lot of empty directories were left over after uninstall in /opt/usr/lib/reGenda.

This shouldn't be the case unless runtime is creating files? That said, blanked removing the directory could remove user created files, which is not something we want to do. Empty folders being left behind is not as large of a concern.

Some pycache files should be only created files by runtime. I don't know how bad it would be if they they will last.

root@reMarkable:/opt/usr/lib/reGenda# find . -name "*.pyc"
./__pycache__/languages.cpython-311.pyc
./__pycache__/calendar_caldav.cpython-311.pyc
root@reMarkable:/opt/usr/lib/reGenda# ls -lh __pycache__/
-rw-r--r--    1 root     root        3.7K Aug 24 19:18 calendar_caldav.cpython-311.pyc
-rw-r--r--    1 root     root        2.4K Aug 24 19:18 languages.cpython-311.pyc

It might be best to target those folders and files explicitly then instead of a blanket delete. Ideally, we could generate them as part of the package process and include them, but we don't really have the build process setup for that yet, as they can only be created on the same architecture.

rm -f /opt/usr/lib/reGenda/**/*.cpython-*.pyc

I was thinking more of find /opt/usr/lib/reGenda/ -name "*.cpython-*.pyc" -exec rm -r {} + because modules in subdirectories can produce pycache as well.

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

Okay, I was doing some more digging. I misremembered, pyc is not architecture dependant, that would be pyd files. So we could compile them easily as part of the build process and only include those. This would require some extra work to make sure to update this package when entware pushes a new version of python.

https://docs.python.org/3/library/py_compile.html
https://docs.python.org/3/library/compileall.html#module-compileall
https://docs.python.org/3/tutorial/modules.html#compiled-python-files

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

It might be best to target those folders and files explicitly then instead of a blanket delete. Ideally, we could generate them as part of the package process and include them, but we don't really have the build process setup for that yet, as they can only be created on the same architecture.

rm -f /opt/usr/lib/reGenda/**/*.cpython-*.pyc

I was thinking more of find /opt/usr/lib/reGenda/ -name "*.cpython-*.pyc" -exec rm -r {} + because modules in subdirectories can produce pycache as well.

That is functionally the same as my example. ** matches all levels of folders.

@tenJirka
Copy link
Author

It might be best to target those folders and files explicitly then instead of a blanket delete. Ideally, we could generate them as part of the package process and include them, but we don't really have the build process setup for that yet, as they can only be created on the same architecture.

rm -f /opt/usr/lib/reGenda/**/*.cpython-*.pyc

I was thinking more of find /opt/usr/lib/reGenda/ -name "*.cpython-*.pyc" -exec rm -r {} + because modules in subdirectories can produce pycache as well.

That is functionally the same as my example. ** matches all levels of folders.

My bad, didn't know that.

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

No worries

@tenJirka
Copy link
Author

Okay, I was doing some more digging. I misremembered, pyc is not architecture dependant, that would be pyd files. So we could compile them easily as part of the build process and only include those. This would require some extra work to make sure to update this package when entware pushes a new version of python.

https://docs.python.org/3/library/py_compile.html https://docs.python.org/3/library/compileall.html#module-compileall https://docs.python.org/3/tutorial/modules.html#compiled-python-files

I guess the decision is up to you because the entware connection is probably nothing that can be done from package recipe.
I can inplement pycache building if you want, but just right clean up looks good enought for me.

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

Okay, I was doing some more digging. I misremembered, pyc is not architecture dependant, that would be pyd files. So we could compile them easily as part of the build process and only include those. This would require some extra work to make sure to update this package when entware pushes a new version of python.
https://docs.python.org/3/library/py_compile.html https://docs.python.org/3/library/compileall.html#module-compileall https://docs.python.org/3/tutorial/modules.html#compiled-python-files

I guess the decision is up to you because the entware connection is probably nothing that can be done from package recipe. I can inplement pycache building if you want, but just right clean up looks good enought for me.

The decision here is actually up to you. I'm fine with merging either at the moment. Do you feel like just getting this done and merged, or trying something slightly new?

Yes, pushing a new version of the package when entware pushes the next major version of python will be something we have to do manually. To some extent, it might still be required if you don't go with the pyc route as well. Up to you.

Longer term I'd like to get a solution for native compilation in toltec of stuff that can't be cross compiled, that way you could make use of pyinstaller or nuitka to make your application truly standalone.

@tenJirka
Copy link
Author

Okay, I was doing some more digging. I misremembered, pyc is not architecture dependant, that would be pyd files. So we could compile them easily as part of the build process and only include those. This would require some extra work to make sure to update this package when entware pushes a new version of python.
https://docs.python.org/3/library/py_compile.html https://docs.python.org/3/library/compileall.html#module-compileall https://docs.python.org/3/tutorial/modules.html#compiled-python-files

I guess the decision is up to you because the entware connection is probably nothing that can be done from package recipe. I can inplement pycache building if you want, but just right clean up looks good enought for me.

The decision here is actually up to you. I'm fine with merging either at the moment. Do you feel like just getting this done and merged, or trying something slightly new?

Yes, pushing a new version of the package when entware pushes the next major version of python will be something we have to do manually. To some extent, it might still be required if you don't go with the pyc route as well. Up to you.

Longer term I'd like to get a solution for native compilation in toltec of stuff that can't be cross compiled, that way you could make use of pyinstaller or nuitka to make your application truly standalone.

I will stick with none pyc compilation and right clean up, because I know it will work.

For longer term if this way of installation will be unwanted I will update it. Right now I'm not sure about pyinstaller because caldav is dependent on lxml which have to be compiled and I don't know how to setup cross compilation for python module right now.
Lxml actually can't be installed via pip on reMarkble as well because of lack of build dependencies and compilation fail.

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

I will stick with none pyc compilation and right clean up, because I know it will work.

For longer term if this way of installation will be unwanted I will update it. Right now I'm not sure about pyinstaller because caldav is dependent on lxml which have to be compiled and I don't know how to setup cross compilation for python module right now. Lxml actually can't be installed via pip on reMarkble as well because of lack of build dependencies and compilation fail.

pyinstaller and nuitka can't do cross compilation, and the solution I'm thinking of to support them would be to have an arm version of the toolchain images that can be used instead for compilation, so you'd be able to install lxml as a build dependency and then pyinstall/nuitka would be able to compile the executable using them. It'll be a while before that is implemented. Which reminds me, I need to open an issue to track this idea.

Lxml is the bane of my existence.

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

I've cancelled the build for a bit, we have to wait for testing to finish updating with the latest change going in, otherwise this build will be building the linux kernel. This is due to how we detect what packages need to be built, we compare against what is in testing, and any that don't exist, or have a different version number will be built. Since the testing build with the new package is still in progress and hasn't been deployed, it thinks that this PR has also modified the linux kernel package.

https://github.com/toltec-dev/toltec/actions/runs/5968320607

@tenJirka
Copy link
Author

I've cancelled the build for a bit, we have to wait for testing to finish updating with the latest change going in, otherwise this build will be building the linux kernel. This is due to how we detect what packages need to be built, we compare against what is in testing, and any that don't exist, or have a different version number will be built. Since the testing build with the new package is still in progress and hasn't been deployed, it thinks that this PR has also modified the linux kernel package.

https://github.com/toltec-dev/toltec/actions/runs/5968320607

Okay totally fine, I was i bit worried if reGenda can't be build or something.
This is actually my first Pull requests so I'm curiously watching how it's going. I'm new to all of this.

@tenJirka
Copy link
Author

I would also like to ask. I'm right that I will have to open new Pull requests when i would like to update this package?

@Eeems
Copy link
Member

Eeems commented Aug 24, 2023

I would also like to ask. I'm right that I will have to open new Pull requests when i would like to update this package?

Correct.

We may also update it independent of you with pull requests in the future as well. Usually this would be to make it consistent with changes to our packaging standards, force a rebuild when a dependency change in entware requires it, or to fix a bug before it gets fixed in your upstream source.

Copy link
Member

@Eeems Eeems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works fine on my reMarkable 1.

@Eeems Eeems merged commit 123b649 into toltec-dev:testing Aug 24, 2023
@Eeems Eeems added this to the 2023-W34 Merge window milestone Aug 24, 2023
Eeems added a commit that referenced this pull request Sep 3, 2023
* Added reGenda

---------

Co-authored-by: Nathaniel van Diepen <[email protected]>
Eeems added a commit that referenced this pull request Oct 3, 2023
### New Packages
- `inject_evdev` - 2.6-1 (#698)
  - Tool to allow injecting evdev (touch, pen, button, etc) events from the command line
- `oxide-utils` - 2.6-1 (#698)
  - Oxide reimplementation of various command line tools https://oxide.eeems.codes/documentation/02_oxide-utils.html
- `regenda` - 0.0.2-1 (#725 #728 #737)
  - Agenda application for reading caldav calendars.

### Updated Packages
- `koreader` - 2023.08-1 (#733)
- `erode`, `fret`, `oxide`, `rot`, `tarnish`, `decay`, `corrupt`, `anxiety`, `liboxide` - 2.6-1 (#698)
- `linux-mainline` - 6.2.0-2 (#723)

### Removed Packages
- `notify-send` (#698)
  - Replaced with `oxide-utils`

### Documentation
- Update building.md to link to toltecmk (#734)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants