Is there a way to display the outdated dependencies from a requirements.txt in a Github wiki? - github

I have a Github wiki that I am maintaining and I want to include a section that displays whether or not the python dependancies within requirements.txt are outdated. I know how to do this manually using:
pip list --outdated
What is the easiest way that I can dynamically have that called whenever the page is accessed? or another method that gives the same result?

"whenever the page is accessed"
I am not aware of a webhook trigger by accessing the page: that would be costly whenever a lot of people want to read said page.
But since a GitHub wiki is a repo, it should be possible, as a pre-push commit to trigger a local command pip list --outdated and modify the wiki locally cloned repo in order to push that output to the wiki, before finally pushing your commit on your regular repo.

Related

How to manage Django Project and its modules with git?

I've been looking for a solution how to manage my project with git for quite some time now. I want to have one instance as the main repo for connecting the entire project. Each app should be its own git instance.
During my search I found both git submodule and git subtree. For both tools I found an instruction how to insert an existing reppo. However, I am interested in how to proceed from the beginning. I mean here from the command $ django-admin startproject myproject Where do I enter the git init? When I create a new app
$ django-admin startapp new-app and how do I use this as subtree/submodule?
Until now I have always found instructions that refer to a remote repo. Is this always necessary? I am not sure if I want to publish every Django app on Github. But I want a version control system just for me. Is this possible?
I have to say that so far it has been enough to manage my "projects" locally. Now I want to work together with others and I don't want to install the whole Django Project locally but only provide me with single functions or modules.
It would be a great help if you could explain to me how that works.
TL;DR
How to manage (start and expand) a Django Project with git. The apps should be their own git repos.
The purpose of submodules is to allow you to graft an existing repo/library into your git. Rarely do you want to do this. Instead you want to use PIP tools to install your libraries as part of library management.
This is essentially a git question. If you don't have a remote repository, you can still use git. With that said, the reason you want a remote repository is so that you can collaborate with others, and have a stored version of the code separate from your workstation.
There are services that let you have private repos even without a paid account. Bitbucket is the most well known of these services and is comparable to Github in most ways.

How to view github pages at specific commit?

I'm trying to view the documentation of a repository at a specific point in time. Is the github pages url hackable enough that I can specific a specific commit hash?
I can't seem to find any information on the web about this.
Once you push your gh-pages branch, old files are replaced by new ones on the static files server. Only one Jekyll build snapshot allowed.
No, you can't. GitHub pages only serves the current content of the gh-pages branch.
You can, however, clone the repo and check out the commit you are looking for locally. You might have to run Jekyll locallly, though, since ts possible to not have the actual HTML files in the gh-pages branch, but a corrrectly set up jekyll page which will get converted by GitHub on-the-fly.
It's not possible via the url but you can always clone the repo and generate the doc yourself at the commit you want.
I am also unable to find an ideal solution. What I do at the moment is to have subdirectories under the branch gh-pages named for example, v1,v2 etc. Then they are accessible as
org.github.io/repo/v1/
org.github.io/repo/v2/
...
This works, but there is almost 100% duplication of content with every version upgrade.

New to git--just need to sync one file

I managed to finally get EGit in Eclipse to work (still don't know how) and I've committed/pushed my current project up to GitHub. So far, so good. Looking at it on GitHub's site, I see it wants me to make a README.md file to provide a nice description. Fine, I think, I'll just use the tool it's providing me with to get it started, then have it sync back down to my local computer where I can further modify it and keep it synced.
So I created a quick README.md file on GitHub's site. But now, when I perform a "Pull" action in Eclipse, I am told that there's nothing new to pull, or something like that. Why is it not getting the new file that was created on GitHub's site, and how can I get it so that I can make changes to it whenever I want?
If you have git installed you can use a terminal and type in the root of your repository:
git pull origin master
or you could try checking out only that file:
git checkout README.md

Problems with my Cydia repo

I am hosting a personal repo for my friends. I am using the cyman script to generate and maintain the repo. I have my repo hosted at http://184.95.54.221/ The problem is that on the iphone when you go into the repo you cannot see the packages and the packages cannot be found. However they are still "listed". You're welcome to install the repo to look.
Make sure your repo has the file called packages.gz
You can create it using the command
dpkg-scanpackages -m . /dev/null >Packages
Your 'Packages' file is invalid. Name, Author, Depiction, Icon - these fields has indentation at the beginning of a line. Remove it and Cydia will see your packages.

Best practice for using one mercurial project in another

What are the best practices for using one mercurial project in another? I've got a django app that I'm working on, but I'm also using mercurial to version control a website that uses that app. I've looked at mercurial subrepositories, but apparently this is considered a "feature of last resort". Is there a good way of doing what I want to do, or do I just have to copy the code from my app into my website repo when I want to update to a new version of my app?
In your specific case I like to let pip handle my django application dependencies: http://guide.python-distribute.org/pip.html#installing-from-a-vcs
We have in our "website" repo a requirements.txt and our deploy does a pip install --upgrade -r requirements.txt That pulls the latest from the repo and installes it into the application's virtual env. This gives nice flexibility and separation while leaving the package management up to pip. With those VCS urls in pip you can point to a specific tag or branch too if you want different sites using different revisions from the same underlying repo.
pip also has a -e /path/to/file mode for pointing to an "editable" clone that's outside the website repo, which would work too, but I've not tried it.
That said, if you think subrepos fit your workflow better by all means use them. They work just fine, but people often get hung up on the workflow constraints ("What do you mean I can't commit my parent repo w/o also committing in the subrepo?!")