-
Notifications
You must be signed in to change notification settings - Fork 38
Developers
If you want to hack on the code, you will need to fork & clone the project. An easy way to work is to symlink the local copy of JSSImporter.py
that is in your fork into your autopkglib
folder (i.e. ln -sf /Library/AutoPkg/autopkglib/JSSImporter.py <this_repos_dir>
). If you are using a different python-jss release, replace the copy in /Library/Application Support/JSSImporter
.
If you want to build JSSImporter packages, we provide a makefile
in the root of the repo. The build process is as follows:
-
You need to install
munkipkg
, which is now used to do the packaging. For this, you needgit
installed on your Mac. After cloningmunkipkg
, it's easiest to create a symlink to/usr/local/bin
so that it is in your path:git clone https://github.com/munki/munki-pkg.git chmod +x munki-pkg/munkipkg sudo ln -s /path/to/munki-pkg/munkipkg /usr/local/bin/munkipkg
-
You need to clone the current
python-jss
into a folder at the same level as yourJSSImporter
folder:git clone https://github.com/jssimporter/python-jss.git
-
You need
pip
. There is more than one way to install pip, but this should work:python -m ensurepip --user python -m pip install --upgrade pip --user
-
Now you can build the package. Run.
make
from the root directory of the repo. The built package will be stored in the<repo>/pkg/jss
folder.cd JSSImporter make
JSSImporter is available primarily as an Apple installer package, which installs the following:
-
JSSImporter.py
is put into/Library/AutoPkg/autopkglib
so AutoPkg can "find" it. - python-jss, which does all of the actual API calls, is put into
/Library/Application Support/JSSImporter
(folder namejss
). JSSImporter inserts this path into the first entry of its python system path so that it will use the python-jss bundled in the installer package over any other instance.
In the past, python-jss was installed from the Python Packaging Index ("pip") like any other python package. This is a common practice for python developers, but can cause confusion when you're only interested in running AutoPkg. This made it easier to install the python requests
module. Therefore, the decision was made to make a dedicated support folder for JSSImporter and use it for storing a copy of python-jss.
This can complicate casually testing upcoming JSSImporter or python-jss releases, but fear not. Read below...
If you are interested in testing a newer version of either JSSImporter or python-jss, you can do so by cloning or downloading the testing branch desired from either project and copying them into the locations listed above in the "How JSSImporter is Installed" section.
JSSImporter will output its version, and that of python-jss, so verbose invocations of AutoPkg will include confirmation of the versions in use.
Python will look in the current working directory for imports before anything in the path, so if you're still seeing older versions listed, make sure you don't have a copy of python-jss in the /Library/AutoPkg/autopkglib folder.
Other questions not addressed here? Join us in the #jss-importer channel on the Mac Admins Slack.