bsc-quantic/pypickup

Save filters in `index.html`

Opened this issue · 4 comments

When you add packages with some filter configuration (like --dev or --platform-specific), it is not saved for later use with the update` command.

In order not to remember them, pypickup should save it into a file and the index.html file inside the package dir already stores the info about the package.

The update command already applies the specified modifiers (-s, --dev, etc.) and make a delta against the remote repository.

Why do we even need to save that for a later use?

How does the update command knows which specifiers or filters did you use with add? You should use the same specifiers because updating is just getting new versions but same filtering.

Also, using the packages' index.html file is a nice structured place where we can save metadata like filters.

In the update command, the user can specify which modifiers to use as well. What would happen then?

Besides, I find it counterintuitive to apply some "ghost" filters that the user should go to check them out in an HTML file. Not clear to me.

The expected behaviour that I had in mind when I coded it is, for instance:

  1. The user adds a packages with the add command and -s modifier, which download only the source files.
  2. The user now wants to obtain the wheels, performs the update and gets them too.

In the approach proposed in this issue, this scenario wouldn't be possible, because you will apply the -s modifier again. Not the way to go imo.

The filters are not hidden, they are defined when you call the add the first time and you should be able to check them up.

The expected behaviour that I had in mind when I coded it is, for instance:

  1. The user adds a packages with the add command and -s modifier, which download only the source files.
  2. The user now wants to obtain the wheels, performs the update and gets them too.

I see your point of view but I do not agree with the point number of 2: A user most probably will call the update command to download new versions of the packages, not to change the filters. With tens (probably hundreds) of packages, it is unrealistic to think that the user will remember which packages do you want wheels, dev versions, filters to apply...

In my mind, there should be a sync command that adds the package if not present in your local cache and fetches new versions if present, and a config command that controls the modifiers to be applied to each package when synced.
I'm opening a new issue for this but the idea behind this issue is that the configuration should be stored in the index.html files.

EDIT: I guess that the best behavior if you add new modifiers to the sync is to override current configuration?