Search Results

Search found 59 results on 3 pages for 'submodule'.

Page 1/3 | 1 2 3  | Next Page >

  • Importing package as a submodule

    - by wecac
    Hi, I have a package 3rd party open source package "foo"; that is in beta phase and I want to tweak it to my requirements. So I don't want to get it installed in /usr/local/lib/python or anywhere in current sys.path as I can't make frequent changes in top level packages. foo/ __init__.py fmod1.py import foo.mod2 fmod2.py pass I want to install the the package "foo" as a sub package of my namespace say "team.my_pkg". So that the "fullname" of the package becomes "team.my_pkg.foo" without changing the code in inner modules that refer "team.my_pkg.foo" as "foo". team/ __init__.py my_pkg/ __init__.py foo/ fmod1.py import foo.mod2 fmod2.py pass One way to do this is to do this in team.my_pkg.init.py: import os.path import sys sys.path.append(os.path.dirname(__file__)) But I think it is very unsafe. I hope there is some way that only fmod1.py and fmod2.py can call "foo" by its short name everything else should use its complete name "team.my_pkg.foo" I mean this should fail outside team/my_pkg/foo: import team.my_pkg import foo But this should succeed outside team/my_pkg/foo: import team.my_pkg.foo

    Read the article

  • git submodule pull and commit automatically on webserver

    - by Lukas Oppermann
    I have the following setup, I am working on a project project with the submodule submodule. Whenever I push changes to github it sends a post request to update.php on the server. This php file executes a git command. Without submodules I can just do a git pull and everything is fine but with submodules it is much more difficult. I have this at the moment, but it does not do what I want. I should git pull the repo and update and pull the latest version of each submodule. <?php echo `git submodule foreach 'git checkout master; git pull; git submodule update --init --recursive; git commit -m "updating"' && git pull && git submodule foreach 'git add -A .' && git commit -m "updating to latest version including submodules" 2>&1s`; EDIT// Okay, I got it half way done. <?php echo `git submodule foreach 'git checkout master; git pull; git submodule update --init --recursive; git commit -am "updating"; echo "updated"' && git pull && git commit -am "updating to latest version including submodules" && echo 'updated'`; The echo prevents the script to stop because of non-zero returned. It works 100% fine when I run it from the console using php update.php. When github initialized the file, or I run it from the browser it still does not work. Any ideas?

    Read the article

  • Clone submodule into directory

    - by andypaxo
    I'm having an issue with creating a submodule in my project. If I create the submodule directly in the repository root, everything works fine. If the submodule is any deeper, the repository does not get cloned. For example, this works as expected: git submodule add git://someproject.com/.git someproject However, when I run the following command, the project is added to .gitmodules and an empty repository is created, but no code is pulled down (even after a git submodule update --init). The command does not produce any output. git submodule add git://someproject.com/.git lib/someproject

    Read the article

  • Git: submodule init and update from different folder

    - by jmccartie
    Trying to write a deployment script, working on a repo in a different path. The "git-dir" flag seems to work fine for most commands, but not for submodule work. Am I missing a path directive? Works: git --git-dir=/tmp/repo_path/.git log Doesn't work: git --git-dir=/tmp/repo_path/.git submodule init Error: No submodule mapping found in .gitmodules for path 'path_to/submodule' Much thanks for any help.

    Read the article

  • How to setup prawn on heroku when installed as a git submodule

    - by brad
    I have a rails app that I am trying to deploy to heroku. This app generates pdfs using prawn. I installed prawn as a git submodule rather than as a gem as this is what is recommended on the prawn website (here). This has not worked well with heroku so far though. As stated on heroku's application constraints page submodules are not supported so I followed their instructions to track the submodule in the main project and tried again. This has not worked and when I access my application I get the following error: App failed to start An error happened during the initialization of your app. This may be due to a typo, wrong number of arguments, or calling a function that doesn’t exists. Check the stack trace below for specific details. Make sure the app is working locally in production mode, by running it with RAILS_ENV (for Rails apps) or RACK_ENV (for Sinatra or other rack apps) set to production. e.g. RAILS_ENV=production script/server. Original Error /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /disk1/home/slugs/208590_03c9c22_67f5/mnt/app/controllers/invoices_controller.rb:37: syntax error, unexpected ')' (SyntaxError) ).to_pdf(@invoice) (and then a whole lot more that I'll spare you from) The .to_pdf function described in the last line is called in a controller in exactly the way described in the prawn how-to that I linked to above so my interpretation of the error message is that prawn is not being installed/detected. Does anyone know how I can address this? I'm new to heroku so have little idea how to approach this. Is the submodule approach for prawn dead in the water from the get-go? Do I need to install it as a gem instead. I'd rather keep it as a submodule just because that works for now and I don't want to break it.

    Read the article

  • Rescuing files and commits from "no branch" in git

    - by Xeoncross
    I started working on some files I had in a git submodule under another project. However, since it was a git submodule it never checked out "master" and instead just checked out the head and placed all the files in the folder in "no branch". Now that I've made some changes by accident to these files I just realized that I was working in a "no branch", submodule of my project. How do I get those files into a branch (like master) so I can rescue them?

    Read the article

  • Git Submodule or fork

    - by Eric
    I have a private repo in github that is the complete source code to my cms. Now I have a few local customers that I want to use the same code base on but with different themes. Is it better to fork the original project out into a repo for each one. Or use a submodule and create a new repo for each customer? After each site is complete I would imagine the theme files wouldn't change much but would need to pull in changes from the main repo when bugs are discovered.

    Read the article

  • Maven: trying to get my submodule's poms to NOT inherit a plugin in the parent

    - by jobrahms
    My project has a parent pom and several submodule poms. I've put a plugin in the parent that is responsible for building our installer distributables (using install4j). It doesn't make sense to have this plugin run on the submodules, so I've put false in the plugin's config, as seen below. The problem is, when I run mvn clean install install4j:compile it cleans, compiles, and runs the install4j plugin on the parent, but then it tries to run it on the child modules and crashes. Here's the plugin config <plugin> <groupId>com.google.code.maven-install4j</groupId> <artifactId>maven-install4j-plugin</artifactId> <version>0.1.1</version> <inherited>false</inherited> <configuration> <executable>${devenv.install4jc}</executable> <configFile>${basedir}/newinstaller/ehd-demo.install4j</configFile> <releaseId>${project.version}</releaseId> <attach>false</attach> <skipOnMissingExecutable>true</skipOnMissingExecutable> </configuration> </plugin> Am I misunderstanding the purpose of inherited=false? What is the correct way to get this to work? I'm using maven 2.2.0.

    Read the article

  • Why does Python's __import__ require fromlist?

    - by ieure
    In Python, if you want to programmatically import a module, you can do: module = __import__('module_name') If you want to import a submodule, you would think it would be a simple matter of: module = __import__('module_name.submodule') Of course, this doesn't work; you just get module_name again. You have to do: module = __import__('module_name.submodule', fromlist=['blah']) Why? The actual value of fromlist don't seem to matter at all, as long as it's non-empty. What is the point of requiring an argument, then ignoring its values? Most stuff in Python seems to be done for good reason, but for the life of me, I can't come up with any reasonable explanation for this behavior to exist.

    Read the article

  • Catch clearly defined exception from sub.submodule in python

    - by mynthon
    I have 3 files. xxx which imports xxx2 and xxx2 imports xxx3 which one raises OppsError exception. xxx3.py: class OppsError(Exception):pass def go(): raise OppsError() xxx2.py: import xxx3 xxx3.go() xxx.py: try: import xxx2 except xxx3.OppsError: print 'ops' When i run xxx.py i get error NameError: name 'xxx3' is not defined. Is importing xxx3 inside xxx only way to catch OppsError?

    Read the article

  • git submodule svn external

    - by Jason
    Let's say I have 3 git repositories, each with a lib and tests folder in the root. All 3 repositories are part of what I want to be a single package, however it is important to me to keep the repositories separate. I am new to git coming from svn, so I have been reading up on submodules and how they differ from svn:externals. In SVN I could have a single lib/vendor/package directory, and inside package I could setup 3 externals pointing to each of my 3 repositories lib directory, renaming it appropriately like lib/vendor/package/a -> repo1/lib lib/vendor/package/b -> repo2/lib lib/vendor/package/c -> repo3/lib but from my understanding this is not possible with git. Am I missing something? Really I'm hoping this can be solved in one of two ways. Someone will point out how to create a 4th git repository which has the other 3 as submodules organized as I have mentioned above (where I can have an a, b, and c folder inside the root) Someone will point out how to set this up using svn:externals in combination with githubs svn support, referencing the lib directory within each git repository (from my understanding this is impossible)

    Read the article

  • How to diff custom file list with WinMerge

    - by tori3852
    Hello, I have a code directory structure, which is this: modudle1 trunk pom.xml branches 1.1 pom.xml modudle2 trunk pom.xml submodule-2.1 pom.xml submodule-2.2 pom.xml branches 1.1 pom.xml submodule-2.1 pom.xml submodule-2.2 pom.xml I need to compare pom.xml files in trunk folders with the ones in branches/1.1: modudle1\trunk\pom.xml modudle1\branches\1.1\pom.xml modudle2\trunk\pom.xml modudle2\branches\1.1\pom.xml modudle2\trunk\submodule-2.1\pom.xml modudle2\branches\1.1\submodule-2.1\pom.xml modudle2\trunk\submodule-2.2\pom.xml modudle2\branches\1.1\submodule-2.2\pom.xml What solutions are available to do this? Is there a solution to use with WinMerge, where I could present a filelist to compare? Other suggestions and tools are welcome, too.

    Read the article

  • Python Class inherit from all submodules

    - by Dhruv Govil
    I'm currently writing a wrapper in python for a lot of custom company tools. I'm basically going to break each tool into its own py file with a class containing the call to the tool as a method. These will all be contained in a package. Then there'll be a master class that will import all from the package, then inherit from each and every class, so as to appear as one cohesive class. masterClass.py pyPackage - __ init__.py - module1.py --class Module1 ---method tool1 - module2.py --class Module2 ---method tool2 etc Right now, I'm autogenerating the master class file to inherit from the packages modules, but I was wondering if there was a more elegant way to do it? ie from package import * class MasterClass(package.all): pass

    Read the article

  • Git submodules not updating?

    - by DavidYell
    I have a project in which I've included some libraries as submodules. They work fine on the machine that you add them on, but when I get home and checkout the repo, I get the folders for the submodules but they are empty. .gitmodules Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ cat .gitmodules [submodule "libraries/lithium"] path = libraries/lithium url = git://github.com/UnionOfRAD/lithium.git [submodule "app/webroot/css/elements"] path = app/webroot/css/elements url = https://github.com/dmitryf/elements.git [submodule "app/libraries/li3_markdown"] path = app/libraries/li3_markdown url = https://github.com/sandelius/li3_markdown.git [submodule "app/webroot/markitup"] path = app/webroot/markitup url = https://github.com/markitup/1.x.git Config and status commands Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ git submodule -af14f48b419310935446176290e1f9dc641400e0 app/libraries/li3_markdown -ebdcd8ca09c874f5e2ef81ec198cc441f37a4f74 app/webroot/css/elements -328291e49a3c7e1fb76b3342f112734864836205 app/webroot/markitup -4980010526d05c556c496ff63951da31828c5943 libraries/lithium Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ git submodule update Neon@Neon-PC /cygdrive/c/xampp/htdocs/learning-lithium $ git submodule status -af14f48b419310935446176290e1f9dc641400e0 app/libraries/li3_markdown -ebdcd8ca09c874f5e2ef81ec198cc441f37a4f74 app/webroot/css/elements -328291e49a3c7e1fb76b3342f112734864836205 app/webroot/markitup -4980010526d05c556c496ff63951da31828c5943 libraries/lithium I added these as you would normally with, git submodule add <repo> <path> git submodule init The submodules are hosted on Github and my repo is hosted on Bitbucket, although I'm not sure if this is relevant.

    Read the article

  • How can I run Git submodules?

    - by marbrun
    How can I run these submodules? The only thing i can find on the web is information on how to create submodules. But i just need to run them. Is this really so difficult? After you have clone the repository, you'll need to run the following to pull in all the submodules: git submodule init git submodule update cd externals/curlcall git submodule init git submodule update

    Read the article

  • What git gotchas have you been caught by?

    - by Bob Aman
    The worst one I've been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but couldn't, so I forked. Now the submodule was pointing at the original library, and I needed it to point at the fork instead. So I deleted the old submodule and replaced it with a submodule for the new project in the same commit. Turns out that this broke everyone else's repositories. I'm still not sure what the correct way of handling this situation is, but I ended up deleting the submodule, having everyone pull and update, and then I created the new submodule, and had everyone pull and update again. It took the better portion of a day to figure that out. What have other people done to accidentally screw up git repositories in non-obvious ways, and how did you resolve it?

    Read the article

  • Capistrano Error

    - by Casey van den Bergh
    I'm Running CentOS 5 32 bit version. This is my deploy.rb file on my local computer: #======================== #CONFIG #======================== set :application, "aeripets" set :scm, :git set :git_enable_submodules, 1 set :repository, "[email protected]:aeripets.git" set :branch, "master" set :ssh_options, { :forward_agent => true } set :stage, :production set :user, "root" set :use_sudo, false set :runner, "root" set :deploy_to, "/var/www/#{application}" set :app_server, :passenger set :domain, "aeripets.co.za" #======================== #ROLES #======================== role :app, domain role :web, domain role :db, domain, :primary => true #======================== #CUSTOM #======================== namespace :deploy do task :start, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end task :stop, :roles => :app do # Do nothing. end desc "Restart Application" task :restart, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end end And this the error I get on my local computer when I try to cap deploy. executing deploy' * executingdeploy:update' ** transaction: start * executing deploy:update_code' executing locally: "git ls-remote [email protected]:aeripets.git master" command finished in 1297ms * executing "git clone -q [email protected]:aeripets.git /var/www/seripets/releases/20111126013705 && cd /var/www/seripets/releases/20111126013705 && git checkout -q -b deploy 32ac552f57511b3ae9be1d58aec54d81f78f8376 && git submodule -q init && git submodule -q sync && export GIT_RECURSIVE=$([ ! \"git --version\" \\< \"git version 1.6.5\" ] && echo --recursive) && git submodule -q update --init $GIT_RECURSIVE && (echo 32ac552f57511b3ae9be1d58aec54d81f78f8376 > /var/www/seripets/releases/20111126013705/REVISION)" servers: ["aeripets.co.za"] Password: [aeripets.co.za] executing command ** [aeripets.co.za :: err] sh: git: command not found command finished in 224ms *** [deploy:update_code] rolling back * executing "rm -rf /var/www/seripets/releases/20111126013705; true" servers: ["aeripets.co.za"] [aeripets.co.za] executing command command finished in 238ms failed: "sh -c 'git clone -q [email protected]:aeripets.git /var/www/seripets/releases/20111126013705 && cd /var/www/seripets/releases/20111126013705 && git checkout -q -b deploy 32ac552f57511b3ae9be1d58aec54d81f78f8376 && git submodule -q init && git submodule -q sync && export GIT_RECURSIVE=$([ ! \"git --version`\" \< \"git version 1.6.5\" ] && echo --recursive) && git submodule -q update --init $GIT_RECURSIVE && (echo 32ac552f57511b3ae9be1d58aec54d81f78f8376 /var/www/seripets/releases/20111126013705/REVISION)'" on aeripets.co.za

    Read the article

  • Sharing code between two or more rails apps... alternatives to git submodules?

    - by jtgameover
    We have two separate rails_app, foo/ and bar/ (separate for good reason). They both depend on some models, etc. in a common/ folder, currently parallel to foo and bar. Our current svn setup uses svn:externals to share common/. This weekend we wanted to try out git. After much research, it appears that the "kosher" way to solve this is using git submodule. We got that working after separating foo,bar,common into separate repositories, but then realized all the strings attached: Always commit the submodule before committing the parent. Always push the submodule before pushing the parent. Make sure that the submodule's HEAD points to a branch before committing to it. (If you're a bash user, I recommend using git-completion to put the current branch name in your prompt.) Always run 'git submodule update' after switching branches or pulling changes. All these gotchas complicate things further than add,commit,push. We're looking for simpler ways to share common in git. This guy seems to have success using the git subtree extension, but that deviates from standard gitand still doesn't look that simple. Is this the best we can do given our project structure? I don't know enough about rails plugins/engines, but that seems like a possible RoR-ish way to share libraries. Thanks in advance.

    Read the article

  • Git repo planning questions

    - by masonk
    At work, development uses perforce to handle code sharing. I won't say "revision control", because we aren't allowed to check in changes until they are ready for regression testing. In order to get my personal change sets under revision control, I've been given the go-ahead to build my own git and initialize the client view of the perforce depot as a git repo. There are some difficulties in doing this, however. The client view lives in a subfolder of ~, (~/p4), and I want to put ~ under revision control as well, with its own separate history. I can't figure out how to keep the history for ~ separate from ~/p4 without using a submodule. The problem with a submodule is that it looks like I have to go make a repository that will become the submodule and then git submodule add <repo> <path>. But there is nowhere to make the submodule's repository except in ~. There seems to be no safe place to create the initial client view of the depot with git p4 clone. (I'm working off of the assumption that initing or cloning a repo into a subdirectory of a git repo is not supported. At least, I can find nothing authoritative on nested git repos.) edit: Is merely ignoring ~/p4 in the repo rooted at ~ enough to allow me to init a nested repo in ~/p4? My __git_ps1 function still thinks I'm in a git repository when I visit an ignored subdirectory of a git repo, so I'm inclined to think not. I need the "remote" repository created by git p4 sync to be a branch in ~/p4. We are required to keep all of our code in ~/p4 so that it doesn't get backed up. Can I pull from a "remote" branch that is really a local branch? This one is just for convenience, but I thought I could learn something by asking it. For 99% of the project, I just want to start the with the p4 head revision as the inital commit object. For the other 1%, I would like to suck down the entire p4 history so that I can browse it in git. IOW, after I'm done initalizing it, the initial commit of remotes/p4/master branch will contain: revision 1 of //depot/prod/Foo/Bar/* revision X of other files in //depot/prod/*, where X is the head revision and the remotes/p4/master branch contains Y commits, where Y is the number of changelists that had a file in //depot/prod/Foo/Bar/*, with each commit in the history corresponding to one of those p4 changelists, and HEAD looking like p4's head.

    Read the article

  • What is the problem git submodules are supposed to solve?

    - by Joshua Dance
    What is the problem that git submodules solve well? When should I use them? Or rather what is their use case? The only use of submodules that I have seen 'in the wild' has been when used to share code between multiple repositories. From what I have experienced, submodules do not appear to be ideally suited to this use case. You run into git update submodule woes and your history gets filled with updating submodule pointer commits. If the 'sharing code' use case is not best solved by submodules, what problems are?

    Read the article

  • Setup a git external for remote repo

    - by Tom
    I'd create a repo which pulls in a remote repo, let's say I'd like to setup jQuery as a submodule for example git://github.com/jquery/jquery.git What would be the process of creating a repo with jQuery as a submodule and adding my own external as a remote repo. Also once this is setup, if I push / pull to my own remote, will the external remain intact?

    Read the article

  • Using git submodules in a git-svn project

    - by Matthias
    In our git-svn managed project, we have 3 upstream projects that are all kept in native git repositories on GitHub. Since the source code of those upstream projects is under our control and changes frequently, our current solution, namely re-deploying the build artifacts to the super-project everytime we change something is quite cumbersome. What I'd like to have is this: parent project (git-svn): --> submodule 1 (git) --> submodule 2 (git) --> submodule 3 (git) That way, the source code for submodules 1-3 is compiled along with the sources for the super project, but I can push changes to submodules separately. The question is: what happens when I git svn dcommit on the parent project? Does this even work? UPDATE Hm, I just set up a simple project structure, trying to resemble this scenario, and I receive this error message when trying to dcommit on the superproject: a0301b11f3544a1e71067ff270eded65e4c8afbd doesn't exist in the repository at /opt/local/libexec/git-core/git-svn line 4775 Failed to read object a0301b11f3544a1e71067ff270eded65e4c8afbd at /opt/local/libexec/git-core/git-svn line 574 Any ideas/suggestions?

    Read the article

  • Storage of various linux config files

    - by stantona
    I'm using git to track/store all my various config files required for linux. They're organized as if they live in my home directory, eg: .Xresources .config/ Awesome rc.lua .xmodmap .zshrc vim/ <- submodule emacs/ <- submodule etc I use git submodules for other things like vim/emacs configuration (since I also want to keep those separate repos). I'm thinking of creating a shell script to create the various links to these files. The goal is to make it easier to setup another linux painlessly. Is this a reasonable idea? Is there a preferred approach? I'm mostly interested in hearing how others people store their configs.

    Read the article

1 2 3  | Next Page >