vsrepo icon indicating copy to clipboard operation
vsrepo copied to clipboard

Large overhaul

Open RivenSkaye opened this issue 2 years ago • 5 comments

This PR does a little more than what fits in a short title.

  • Removes the double pound sign before the License block comment
  • Code deduplication in both vsrepo.py and vsrupdate.py
  • Sorts imports and cleans them up a bit
  • Uses exception types for except blocks
  • Doesn't throw blank Exceptions anymore
    • These have been replaced with types of exceptions better suited to the context
  • Uses pathlib.Path for path operations instead of os.path
    • This also means some sanity checking is done for path legality
    • Should prevent accidentally adding expandable variables in a path
  • Shortens lines to 120 characters long max for readability
  • Normalizes use of quotes. Went with single quotes as those were the most common
    • If a string contains a single quote (or apostrophe), outer quotes are double to prevent escapes
  • Uses more f-strings instead of concatenation
  • Some cleanup to make things more readable and a little less code for the same result

Specific to vsrupdate:

  • vsrupdate now outputs a new package to the current working directory unless an explicit output directory is specified
  • Doesn't put a hard requirement on the source attribute of a type: PyWheel package anymore, as this is already not present on all PyWheels (vsrupdate)
  • Cleans up some really ugly and endlessly nested code and copy-pasted stuff
  • standardizes the JSON writes to use the same indentation everywhere
  • Uses some more code equal to vsrepo instead of doing something else for the same result
  • figures out the base local path before doing other stuff

Specific to vsrepo:

  • Adds recognition of editable installs of packages as devel versions
    • Prevents having installed the same package as editable and through vsrepo
    • Prevents marking a package as installable if an editable install is present

RivenSkaye avatar Mar 12 '22 18:03 RivenSkaye

Also adds rvsfunc to the package list

RivenSkaye avatar Mar 12 '22 18:03 RivenSkaye

I made only a quick test with my bat files and noticed 2 things: (I have not looked at the code yet)

  • in rvsfunc the category is empty (you can verify with vsrupdate.py compile) + dependencies are not valid. It looks for the identifier not the namespace. Simply change: descale => "tegaf.asi.xe", znedi3 => "xxx.abc.znedi3"
  • I always get No win64 release found or No script found when it tries to find the binaries in the release zip. You can test with colorbars and xvc, they have new releases.

Here's a handy single package update bat

python vsrupdate.py compile
set /p plugin=plugin name:
python vsrupdate.py -p  %plugin%  update-local -o 
pause

theChaosCoder avatar Mar 25 '22 08:03 theChaosCoder

I've updated the listed dependencies and categories in rvsfunc as per your suggestions, fixed a small oversight on my end that could cause conflicts uninstalling binary plugins and double checked everything. But I can't seem to be able to reproduce your problem about there being no win64 releases for any of them. Checked both colorbars and xvs, the name xvc doesn't seem to exist, so I guessed it was a typo

This is on a clean env by the way, I just upgraded to Python 3.10 and pushed my own vsrepo fork into the folder below C:/Program Files/Vapoursynth to test this

image image

RivenSkaye avatar May 15 '22 12:05 RivenSkaye

Someone wants to write it in Python? Here I thought I could program C++ in Python all day long undisturbed.

myrsloik avatar May 15 '22 20:05 myrsloik

I meant vsrupdate not vsrepo.

Delete the R3 entry in colorbars.json Then run python vsrupdate.py -p colorbars update-local -o You will get

R3 (new)
ColorBars R3 win32: 100%|█████████████████████████████████████████████████████████| 55.7k/55.7k [00:00<00:00, 2.71MB/s]
No win32 release found.
No win64 release found.

If you try it with the current master you'll get Release file updated

rvsfunc: the category must be Scripts not Script. vsrupdate.py compile has a check function build in :-)

theChaosCoder avatar May 15 '22 22:05 theChaosCoder