Comments (3)
def get_repo_urls(self, repo_names: Iterable[str]) -> List[str]:
"""Get repo urls for all specified repo names in the current organization.
Assumes that the repos exist, there is no guarantee that they actually do
as checking this with the REST API takes too much time.
Args:
repo_names: A list of repository names.
Returns:
a list of urls corresponding to the repo names.
"""
org_url = self._api._org.html_url
return [
"{}/{}".format(org_url, repo_name) for repo_name in list(repo_names)
]
from repobee.
def _repo_names_to_urls(repo_names: Iterable[str],
api: github_api.GitHubAPI) -> List[str]:
"""Use the repo_names to extract urls to the repos. Look for git repos
with the correct names in the local directory and create local uris for them.
For the rest, create urls to the repos assuming they are in the target
organization. Do note that theere is _not_ guarantee that the remote repos
exist as checking this takes too much time with the REST API.
A possible improvement would be to use the GraphQL API for this function.
Args:
repo_names: names of repositories.
api: A GitHubAPI instance.
Returns:
a list of urls corresponding to the repo_names.
"""
local = [
name for name in repo_names if util.is_git_repo(os.path.abspath(name))
]
non_local = [name for name in repo_names if name not in local]
non_local_urls = api.get_repo_urls(repo_names)
local_uris = [
pathlib.Path(os.path.abspath(repo_name)).as_uri()
for repo_name in local
]
return non_local_urls + local_uris
from repobee.
This is miles faster (as no HTTP calls are made). It makes the tool so much more snappy.
from repobee.
Related Issues (20)
- `reviews check` fails to map lowercase usernames HOT 4
- Refactor the GitLab system tests
- Create organization HOT 5
- Systematic way to update Docker Hub HOT 4
- Add support for configurable arguments in mutex groups HOT 1
- Deprecate the `--students-file` option and let `--students` suppleant it HOT 1
- Make it possible to deprecate options
- Plugin core commands allow both `--students` and `--students-file` options to be specified
- Handle GitHub rate limiting HOT 11
- Replace home-built Retry-After code with urllib3's builtin support HOT 3
- False negatives: repobee reviews check HOT 6
- Question: Is there any way to check which student repositories have commits? HOT 4
- Reviews: Timeouts during review assignments not able to "resume from previous" HOT 9
- Can't find student repositories when updating HOT 2
- Drop support for Python 3.7 HOT 2
- Minor typo in resolve_repobee_pip_uri function of install.sh HOT 4
- Add periodic CI job that ensures the installer can run on the current release HOT 1
- Make install script install from PyPi if possible HOT 1
- How to delete repos created by repobee (800 repos!) HOT 4
- Plugin subcommand has disappeared in v3.8.1 HOT 3
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 repobee.