How to add a private dependency to a manifest.toml file in Julia? - julia

I am trying to commit my manifest.toml file for a private Julia project that has a private dependancy. In the manifest.toml file, it has a local path to the project for the private dependancy as follows:
[[Private_Package]]
deps = ["AbstractTrees", "D3Trees", "DataStructures", "Distributions", "LinearAlgebra", "POMDPs", "Parameters", "Printf", "Random", "StatsBase"]
path = "/Users/logankilpatrick/.julia/dev/Private_Package"
uuid = "rand-rand-rand"
version = "0.X.0"
How can I keep this in my manifest file but make sure it's not a local path so I can commit to the repo?

I ended up going with Pkg.add() per #kevbonham suggestion. It did the trick:
[[Private_Package]]
deps = ["AbstractTrees", "D3Trees", "DataStructures", "Distributions", "LinearAlgebra", "POMDPs", "Parameters", "Printf", "Random", "StatsBase"]
git-tree-sha1 = "x_x_x"
repo-rev = "master"
repo-url = "https://github.com/Private_Package/Private_Package.git"
uuid = "rand-rand-rand-rand-rand"
version = "0.2.0"
Thank you both #DavidVarela

Related

In a sbt project, how to get full list of dependencies with scope?

In a sbt project, how to get full list of dependencies(including transitive dependencies) with scope?
For Example:
xxx.jar(Compile)
yyy.jar(Provided)
zzz.jar(Test)
...
From the sbt shell you can execute one or all of the following commands:
Test / fullClasspath
Runtime / fullClasspath
Compile / fullClasspath
Which will output the jars associated with the scope (Test/Runtime/Compile).
If you want to get a bit more fancy, sbt provides a number of ways of interacting with the outputs generated through the dependency management system. The documentation is here.
For example, you could add this to your build.sbt file:
lazy val printReport = taskKey[Unit]("Report which jars are in each scope.")
printReport := {
val updateReport: UpdateReport = update.value
val jarFilter: ArtifactFilter = artifactFilter(`type` = "jar")
val testFilter = configurationFilter(name = "test")
val compileFilter = configurationFilter(name = "compile")
val testJars = updateReport.matching(jarFilter && testFilter)
val compileJars = updateReport.matching(jarFilter && compileFilter)
println("Test jars:\n===")
for (jar <- testJars.sorted) yield {println(jar.getName)}
println("\n\n******\n\n")
println("compile jars:\n===")
for (jar <- compileJars.sorted) yield {println(jar.getName)}
}
It creates a new task printReport which can be executed like a normal sbt command with sbt printReport. It takes the value of the UpdateReport which is generated by the update task, and then filters for jar files in the respective test/compile scopes before printing the results.

Yocto recipe pyinstaller

I'm trying to build pyinstaller recipe, I used pipoe here , but I got this error while i Told it to inherit pypi setuptools. Can anyone help please?
THank you .
ERROR: ParseError at /home/yasmine/yocto/poky/meta-pyinst/recipes-pyinstaller/pyinstaller/python-altgraph_0.17.bb:16: Could not inherit file classes/setuptools.bbclass
First, it is good practice to use pipoe to create python recipes automatically.
Check my response here on how to use it.
I used it to create pyinstaller recipe, it detected that pyinstaller depends, in run time RDEPENDS, on:
python3-altgraph
python3-pyinstaller-hooks-contrib
So, here are the recipes:
python3-pyinstaller_4.5.1.bb
SUMMARY = "PyInstaller bundles a Python application and all its dependencies into a single package."
HOMEPAGE = "http://www.pyinstaller.org/"
AUTHOR = "Hartmut Goebel, Giovanni Bajo, David Vierra, David Cortesi, Martin Zibricky <>"
LICENSE = "CLOSED"
SRC_URI = "https://files.pythonhosted.org/packages/a9/d9/9fdfb0ac2354d059e466d562689dbe53a23c4062019da2057f0eaed635e0/pyinstaller-4.5.1.tar.gz"
SRC_URI[md5sum] = "cd1fab890e538ed62ac9121e043632e3"
SRC_URI[sha256sum] = "30733baaf8971902286a0ddf77e5499ac5f7bf8e7c39163e83d4f8c696ef265e"
S = "${WORKDIR}/pyinstaller-4.5.1"
RDEPENDS_${PN} = "python3-setuptools python3-altgraph python3-pyinstaller-hooks-contrib"
DEPENDS += "python3-wheel python3-wheel-native"
inherit setuptools3
python3-pyinstaller-hooks-contrib_2021.2.bb
SUMMARY = "Community maintained hooks for PyInstaller"
HOMEPAGE = "https://github.com/pyinstaller/pyinstaller-hooks-contrib"
AUTHOR = " <>"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=822bee463f4e00ac4478593130e95ccb"
SRC_URI = "https://files.pythonhosted.org/packages/eb/fa/fe062e44776ab8edb4ac62daca1a02bb744ebdd556ec7a75c19c717e80b4/pyinstaller-hooks-contrib-2021.2.tar.gz"
SRC_URI[md5sum] = "322f5534dd0df2d3fbb8fd55ec7cddbf"
SRC_URI[sha256sum] = "7f5d0689b30da3092149fc536a835a94045ac8c9f0e6dfb23ac171890f5ea8f2"
S = "${WORKDIR}/pyinstaller-hooks-contrib-2021.2"
RDEPENDS_${PN} = ""
inherit setuptools3
python3-altgraph_0.17.bb
SUMMARY = "Python graph (network) package"
HOMEPAGE = "https://altgraph.readthedocs.io"
AUTHOR = "Ronald Oussoren <ronaldoussoren#mac.com>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3590eb8d695bdcea3ba57e74adf8a4ed"
SRC_URI = "https://files.pythonhosted.org/packages/22/5a/ac50b52581bbf0d8f6fd50ad77d20faac19a2263b43c60e7f3af8d1ec880/altgraph-0.17.tar.gz"
SRC_URI[md5sum] = "9450020282270749db205038b8c90b55"
SRC_URI[sha256sum] = "1f05a47122542f97028caf78775a095fbe6a2699b5089de8477eb583167d69aa"
S = "${WORKDIR}/altgraph-0.17"
RDEPENDS_${PN} = ""
inherit setuptools3
If you have a custom layer, you can create:
meta-custom/recipes-python/pyinstaller
and put all three recipes inside that.
Now, just add python3-pyinstaller to IMAGE_INSTALL :
IMAGE_INSTALL_append = " python3-pyinstaller"
It could be that your setup only have python3 so you either change the inherit from setuptools to setuptools3, or your tell pipoe to use python3 by typing:
pipoe --python python3 --package pyinstaller
If you then read the generated files you would see that it inherits setuptools3.

ConanException: Package require 'qt' not used in components requires

I've created a project which has two targets, core.dll and runner.exe.
Core.dll depends on Qt5::Core.
Runner.exe depends on core.dll.
Also I've created a conan recipe conanfile.py.
I defined qt in requirements:
def requirements(self):
self.requires("qt/e5.12.4#mikhail/testing", private=False)
In package_info I use components:
def package_info(self):
self.cpp_info.components["core"].libs = ["core"]
self.cpp_info.components["core"].requires = ["qt"]
self.cpp_info.components["runner"].requires = ["core"]
On build I have error:
File
"C:\Users\user\AppData\Roaming\Python\Python37\site-packages\conans\client\installer.py",
line 571, in _call_package_info
raise ConanException("%s package_info(): %s" % (str(conanfile), e)) conans.errors.ConanException: lexer/1.0.0#mikhail/testing
package_info(): Package require 'qt' not used in components requires
I assume I miss some detail. I would appreciate any advice or reference to read about.
conanfile.py
from conans import ConanFile, CMake, tools
import os.path
class LexerConan(ConanFile):
name = "lexer"
license = "Proprietary"
author = "Mikhail"
topics = ("lexer")
version = "1.0.0"
settings = {
"os": ["Windows"],
"compiler": None,
"build_type": None,
"arch": None
}
options = {"shared": [True, False]}
default_options = {
"shared": False
}
generators = "cmake_paths"
exports_sources = "*"
no_copy_source = True
def build_requirements(self):
self.build_requires("cmake-toolkit/1.0.0#mikhail/stable")
self.build_requires("cmake/3.17.1")
def requirements(self):
self.requires("qt/e5.12.4#mikhail/testing", private=False)
def build(self):
cmake = CMake(self)
cmake.definitions["VERSION"] = self.version
cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = os.path.join(self.build_folder, "conan_paths.cmake")
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.configure()
cmake.install()
def package_info(self): #ERROR ConanException: Package require 'qt' not used in components requires
self.cpp_info.components["core"].libs = ["core"]
self.cpp_info.components["core"].requires = ["qt"]
self.cpp_info.components["runner"].requires = ["core"]
If you need more details I created a reference project on GitHub
I had to use namespace qt::qt.
self.cpp_info.components["core"].requires = ["qt::qt"]

Upload files within nested folders in AWS S3 using R

I am looking a way where I can upload files with in a nested folder using R Programming
I tried below functions which uploads either file or folder from aws.s3 package
library("aws.s3")
put_object("pathoftheobject", object = "filename", bucket = "bucketname")
put_folder("foldername", bucket = "bucketname")
Folder Structure and Files :
ParentFolder
SubFolder1
File1
File2
SubFoler2
File3
File4
............
SubFoldern
Filen
Any guidance here will be really useful.
I'm not an R developer but in C# instead of creating folders under buckets, I use filename with / so S3 recognizes that as sub-folder.
my file name when uploading:
ParentFolder/SubFolder1/Fil1
ParentFolder/SubFolder1/Fil2
ParentFolder/SubFolder2/Fil3
aws.s3::s3sync function does the needful.
library(aws.s3)
Sys.setenv("AWS_ACCESS_KEY_ID" = access_key_id,
"AWS_SECRET_ACCESS_KEY" = secret_access_key,
"AWS_DEFAULT_REGION" = "eu-central-1",
"AWS_SESSION_TOKEN" = session_token)
s3sync(files =dir(paste0(getwd(), "/Folder1Name/","Folder2Name"),recursive = T),
bucket = "BucketName", direction = "upload",verbose = TRUE)

Generic SOURCES definition in automake depending on other variable

I'm new to Autotools and I'm trying to add gtest Unit Tests to a project that is using Autotools.
I have a simple directories structure:
. - main
./src - sources
./tests - tests
./paths - git submodule with paths
In tests directory I have one cpp file per tested class and my Makefile.am looks like so:
AUTOMAKE_OPTIONS = serial-tests
AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/paths -DUNIT_TEST
AM_LDFLAGS = -pthread
LDADD = -lgtest -lgtest_main
TESTS = test_networkconfig test_dummy ### depending on content of this variable
check_PROGRAMS = $(TESTS)
test_networkconfig_SOURCES = test_networkconfig.cpp ### generate this
test_networkconfig_LDADD = $(top_srcdir)/src/networkconfig.o \
-lgtest \
-lgtest_main
test_networkconfig_CPPFLAGS = $(somelibrary_CFLAGS)
test_dummy_SOURCES = test_dummy.cpp ### and this variable
I would like to automatically generate:
test_networkconfig_SOURCES = test_networkconfig.cpp
test_dummy_SOURCES = test_dummy.cpp
Is there a way to create a variable <some_name>_SOURCES = <some_name>.cpp for each value that is held by TESTS variable?
In Automake you can only do this in a limited way. In particular, for a program P, if P_SOURCES is not defined, then Automake will compute a default using the program name and the value of AM_DEFAULT_SOURCE_EXT (defaults to .c).
So in your case:
AM_DEFAULT_SOURCE_EXT = .cpp
should do the trick.

Resources