Conda-Build with Git repo as source: can I include only some files of the repo? - package

I'm sorry if this question is stupid but I'm very new to conda and I cannot find relevant informations about this problem.
I have to build a small package with conda-build. The package only needs to include two python files, but they are located inside a much bigger git repo. Is there a way in my meta.yaml to specify that the source is this repo but only files A and B needs to be included in the package?
I've set up the meta.yaml with the source field pointing to the repo, but I could not find ways to specify that only some files need to be included in the final package.

Related

How to manage 3rdparty library in git repo

I am looking for suggestions on how to manage C' 3rd party libraries in my git repos.
I'm maintaining two git repositories:
repo A - my main repository, which contains my program source code
repo B - secondary repository which contains many private libraries source code.
Repo A is dependent on some libraries from repo B and those libraries required for successful compilation.
What is the right way of getting the required libraries from repo B?
Few approaches I thought of:
Git submodule gives me everything I need. The only cons here is that repo B is very large, and I need only a few modules within that repository. There is a way to define only parts of repo B as a submodule?
Git hooks - Creating git hooks which download compiled version of the libraries (.so) save them in libs/ folder. The link to the libraries will be supplied in a file. In every branch checkout, the hook needs to check if a different version of the libraries should be downloaded.
(Never worked with git hooks, I'm not sure if it is possible)
Thanks.

Git-Ignore in Xcode

I am using X-Code 10 as a C IDE. I am doing a group project and we must use GitLab to share the code. To work in Xcode there are a lot of files to make Xcode work, but none that I need to share with my partners who are using their own IDE and who just need the .c files we are working on. How do I make Git not upload ALL files and just the .c?
There are ways to handle the excludes for a git project. There is the .gitignore file where you can create rules for what files should be excluded from your project. This file will be tracked by git, so you and your teammates will be sharing this file.
For your own personal excludes, you can put them into the .git/info/exclude file. This will not be tracked by git and will affect only your own local repository. This is a good place put rules that are specific to your own workflow.

Git didn't add x64\SQLite.Interop.dll

I installed SQLite into my WPF project via Nuget. Then added the entire project to a remote repo. Then I cloned the project on another machine, and had a broken build.
x64\SQLite.Interop.dll was missing.
I'm puzzled why Git didn't include one file from my project. I checked the repo on BitBucket and confirmed it is not there. Git status reports nothing to commit, working directory clean
It added the x86 version, but not the x64 version, I can't imagine why.
(project)\x64\SQLite.Interop.dll Git ignored this file!
(project)\x86\SQLite.Interop.dll
You might want to check the .gitignore file at the root of the repo. If it contains for example x64, it would ignore this file.
There would be two main possibilities then:
edit this file to fit your need
or force this file to be added; ie: git add -f x64/SQLite.Interop.dll
However, committing binary files is often frowned upon. It's true in particular if you want to keep up to date with the latest package, hence if you plan to commit new versions of the dlls on a regular basis.
You might rather want to consider Nuget package restore feature. Basically the idea is that you commit a config file, and the client will automatically download the corresponding packages.

proper way to handle common header files with C and Git

So i have folders like this
c:\projects\generic\
c:\projects\project1\
c:\projects\project2\
Each folder under projects are their own separate local git repository. A project may use one or more header files from the generic folder. If a project uses a header file, it needs to be right in the project folder, not a subfolder under the project folder. Also, I probably wouldn't want the latest and greatest, I'd want to pull it by tag so I could be sure I have a specific version of the file in use for that project.
How would I do that? Is this something that could be done with submodules? Is there a better way to organize the folders in this situation?
I'd want [...] a specific version of the file in use for that project.
Yup: submodules are for exactly that. A submodule is a nested repository, the using projects' commits record (only) exactly which (other) commit SHA they need checked out at the submodule's path, git submodule just does the chores of getting the right submodule commits checked out when you want.
If a project uses a header file [from another repository], it needs to be right in the project folder, not a subfolder under the project folder [... I'm on windows].
It's lucky these are headers, otherwise there'd be a problem with that combination. As it is, the compiler can chase the relative pathnames with a #include "relative/path/to/submodule/header.h":
repo
|--generic.h: "#include generic1/generic.h"
|--generic1
|--generic.h: the real thing

Pull down a file from a remote repo during a clone of your own

I've had a look at one or two similar questions on Stack Overflow, but they don't address what I am looking for exactly, unless I've missed it somewhere.
What I have is my own repo that contains custom boilerplate code. In my repo I'd like to include files from various other remote repo's (not my own). Thus when I'm ready to work on a new project, I can clone my repo, get my boilerplate code, as well as the files from the various other repo's I usually go to manually and download from. This way preferably the up to date versions are pulled as opposed to just copying these files into my own repo and having to update them every time there is a revision.
Is this possible to do simply using Git/GitHub?
Submodule is the way to include other repos.
And you now can define a submodule to follow a branch (git 1.8.2+), which means this will bring you the latest commits of said branch.
git submodule update --remote
I do that in my compileEverything GitHub repo, where I include the latest from Semantic-UI master branch.
That is because my .gitmodules looks like:
[submodule "Semantic-UI"]
path = Semantic-UI
url = https://github.com/jlukic/Semantic-UI
branch = master
I'm not particularly looking to include an entire repo/branch but just a select few files within one.
Example: Normalize.css Still possible to do?
No. It is best to:
include the full repo through a submodule (since the submodule pointer itself hardly takes any place in your repo)
keep in the parent repo symlinks to the files you need from that submodule.
That way, you see:
the files you want (symlinked to the same files from the subrepo)
the subrepo reference, that you can update at will.

Resources