Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Anaconda API #2

Merged
merged 17 commits into from Sep 10, 2019

Conversation

@tyrelsouza
Copy link
Member

commented Sep 6, 2019

Copied then pretty much completely dissected https://github.com/librariesio/cocoapods-api So a lot of the decisions like urls come from that.

I added a channel/package url though. for when defaults isn't the only one we support.

$ docker-compose build
$ docker-compose up

$ curl localhost:9292/packages.json
[
    "pkgs/main/r-uuid",
    "pkgs/main/libice-devel-cos6-x86_64",
    "pkgs/main/libsepol-devel-cos6-x86_64",
    "pkgs/main/r-ttr",
    "pkgs/main/pytest-selenium",
    "pkgs/main/libsm-cos6-i686",
    "pkgs/main/gmpy2",
    "pkgs/main/expat-devel-cos7-ppc64le",
    "pkgs/main/crosstool-ng",
    "pkgs/main/metis",
    "pkgs/main/r-xml2",
    "pkgs/main/r-survival",
.......


$ curl localhost:9292/packages/urllib3.json
"1.25.3"

$ curl localhost:9292/packages/pkgs/main/urllib3.json
"1.25.3"

tests

$ rspec

FWIW: my Paw tests are here.
conda-api.paw.zip

@tyrelsouza

This comment has been minimized.

Copy link
Member Author

commented Sep 6, 2019

Ruby version is old because of feedtosis but I don't know if I need that for the way this will be done
(I intend cron task downloading and re-parsing every half hour, thoughts?)

@tyrelsouza

This comment has been minimized.

Copy link
Member Author

commented Sep 6, 2019

Could also add feed.rb like from cocoapods-api and just re-parse pkgs/main any time there's a new rss feed from anaconda, then we're not parsing at like 2am when no one is really doing any anaconda channel updating?

@tyrelsouza tyrelsouza requested review from havocp, katzj and kbarrette Sep 9, 2019

app.rb Outdated Show resolved Hide resolved
@katzj
Copy link
Member

left a comment

Looks pretty straight forward and reasonable to me 👍

One or two tiny things but let's get it going

.gitignore Outdated Show resolved Hide resolved
Capfile Outdated Show resolved Hide resolved
Gemfile Outdated Show resolved Hide resolved
LICENSE.txt Outdated Show resolved Hide resolved
tyrelsouza added 2 commits Sep 9, 2019
@tyrelsouza

This comment has been minimized.

Copy link
Member Author

commented Sep 9, 2019

also i need a travis/circle file

@kbarrette
Copy link

left a comment

If possible, I'd like to see a request spec to show that everything is wired up properly.

conda_repo.rb Outdated Show resolved Hide resolved
conda_repo.rb Outdated Show resolved Hide resolved
app.rb Outdated Show resolved Hide resolved
tyrelsouza added 7 commits Sep 9, 2019
@katzj

This comment has been minimized.

Copy link
Member

commented Sep 10, 2019

LGTM, will let @kbarrette give the 👍

tyrelsouza added 4 commits Sep 10, 2019

@tyrelsouza tyrelsouza requested a review from kbarrette Sep 10, 2019

@kbarrette
Copy link

left a comment

Looks great

conda.rb Outdated

def package(channel, name)
pack = @redis.get("packages:#{channel}/#{name}")
return nil unless pack

This comment has been minimized.

Copy link
@kbarrette

kbarrette Sep 10, 2019

Just return unless

app.rb Outdated
# frozen_string_literal: true

require "sinatra/base"
require "./conda"

This comment has been minimized.

Copy link
@kbarrette

kbarrette Sep 10, 2019

I think require_relative "conda" might be more idiomatic, or even better, adjusting your load path so you can just require "conda"

tyrelsouza added 2 commits Sep 10, 2019

@tyrelsouza tyrelsouza merged commit ef2ff7f into master Sep 10, 2019

1 check passed

Tidelift Dependencies checked
Details

@tyrelsouza tyrelsouza deleted the initial-conda-api branch Sep 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.