Skip to content

Commit eda8c92

Browse files
committedMar 19, 2025
Update metadata
1 parent c300deb commit eda8c92

19 files changed

+445
-180
lines changed
 

‎.metadata-python/Makefile

-49
This file was deleted.

‎.metadata/LICENSE

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Janelia Open-Source Software (3-clause BSD License)
2+
3+
Copyright 2025 Howard Hughes Medical Institute
4+
5+
Redistribution and use in source and binary forms, with or without modification,
6+
are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation and/or
13+
other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

‎.metadata/Makefile

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# This file is generated automatically from metadata
2+
# File edits may be overwritten!
3+
4+
.PHONY: upload
5+
upload: metadata package twine add clean
6+
7+
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
8+
MAKEFILE_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
9+
GUIX-TIME-MACHINE = guix time-machine -C $(MAKEFILE_DIR)/guix/channels.scm
10+
GUIX-SHELL = $(GUIX-TIME-MACHINE) -- shell -f $(MAKEFILE_DIR)/guix/guix.scm
11+
GUIX-DEV-SHELL = $(GUIX-TIME-MACHINE) -- shell -D -f $(MAKEFILE_DIR)/guix/guix.scm
12+
CONTAINER = --container --network --preserve='^DISPLAY$$' --preserve='^TERM$$'
13+
GUIX-CONTAINER = $(GUIX-SHELL) $(CONTAINER)
14+
GUIX-DEV-CONTAINER = $(GUIX-DEV-SHELL) $(CONTAINER)
15+
VENV-SHELL = rm -rf .venv; mkdir .venv; python3 -m venv .venv; source .venv/bin/activate
16+
DOCKER-DEV-IMAGE = docker build -f $(MAKEFILE_DIR)/docker/Dockerfile.dev -t serial_interface-dev .
17+
DOCKER-DEV-CONTAINER = $(DOCKER-DEV-IMAGE); docker run -it serial_interface-dev
18+
DOCKER-IMAGE = $(DOCKER-DEV-IMAGE); docker build -f $(MAKEFILE_DIR)/docker/Dockerfile -t serial_interface .
19+
DOCKER-CONTAINER = $(DOCKER-IMAGE); docker run -it serial_interface
20+
21+
.PHONY: guix-shell
22+
guix-shell:
23+
$(GUIX-SHELL)
24+
25+
.PHONY: guix-dev-shell
26+
guix-dev-shell:
27+
$(GUIX-DEV-SHELL)
28+
29+
.PHONY: guix-dev-container
30+
guix-dev-container:
31+
$(GUIX-DEV-CONTAINER)
32+
33+
.PHONY: guix-dev-container-ipython
34+
guix-dev-container-ipython:
35+
$(GUIX-DEV-CONTAINER) -- ipython --no-autoindent
36+
37+
.PHONY: guix-container
38+
guix-container:
39+
$(GUIX-CONTAINER) python-ipython --rebuild-cache
40+
41+
.PHONY: requirements.txt
42+
requirements.txt:
43+
$(GUIX-DEV-CONTAINER) -- $(VENV-SHELL);\
44+
pip install .;\
45+
pip freeze --local --exclude serial_interface > requirements.txt;\
46+
deactivate;\
47+
rm -rf .venv
48+
49+
.PHONY: docker-dev-container
50+
docker-dev-container:
51+
$(DOCKER-DEV-CONTAINER)
52+
53+
.PHONY: docker-dev-container-ipython
54+
docker-dev-container-ipython:
55+
$(DOCKER-DEV-CONTAINER) ipython --no-autoindent
56+
57+
.PHONY: docker-container
58+
docker-container:
59+
$(DOCKER-CONTAINER)
60+
61+
.PHONY: metadata-edits
62+
metadata-edits:
63+
$(GUIX-DEV-CONTAINER) -- sh -c "emacs -q --no-site-file --no-site-lisp --no-splash -l $(MAKEFILE_DIR)/emacs/init.el --file $(MAKEFILE_DIR)/metadata.org"
64+
65+
.PHONY: metadata
66+
metadata: requirements.txt
67+
$(GUIX-DEV-CONTAINER) -- sh -c "emacs --batch -Q -l $(MAKEFILE_DIR)/emacs/init.el --eval '(process-org \"$(MAKEFILE_DIR)/metadata.org\")'"
68+
69+
.PHONY: package
70+
package:
71+
$(GUIX-DEV-CONTAINER) -- sh -c "python3 setup.py sdist bdist_wheel"
72+
73+
.PHONY: twine
74+
twine:
75+
$(GUIX-DEV-CONTAINER) --network --expose=$$HOME/.pypirc --expose=/etc/ssl/certs/ca-certificates.crt -- sh -c "twine upload dist/*"
76+
77+
.PHONY: add
78+
add:
79+
$(GUIX-DEV-CONTAINER) -- sh -c "git add --all"
80+
81+
.PHONY: clean
82+
clean:
83+
$(GUIX-DEV-CONTAINER) -- sh -c "git clean -xdf"
84+
85+
PORT = /dev/ttyACM0
86+
GUIX-DEV-CONTAINER-PORT = $(GUIX-DEV-SHELL) $(CONTAINER) --expose=$(PORT)
87+
GUIX-CONTAINER-PORT = $(GUIX-SHELL) $(CONTAINER) --expose=$(PORT)
88+
DOCKER-DEV-CONTAINER-PORT = $(DOCKER-DEV-IMAGE); docker run -it --device=$(PORT) serial_interface-dev
89+
DOCKER-CONTAINER-PORT = $(DOCKER-IMAGE); docker run -it --device=$(PORT) serial_interface
90+
91+
.PHONY: guix-dev-container-port-serial
92+
guix-dev-container-port-serial:
93+
$(GUIX-DEV-CONTAINER-PORT) picocom -- picocom -b 2000000 -f n -y n -d 8 -p 1 -c $(PORT)
94+
95+
.PHONY: guix-dev-container-port-ipython
96+
guix-dev-container-port-ipython:
97+
$(GUIX-DEV-CONTAINER-PORT) -- ipython --no-autoindent
98+
99+
.PHONY: guix-container-port
100+
guix-container-port:
101+
$(GUIX-CONTAINER-PORT) python-ipython --rebuild-cache
102+
103+
.PHONY: docker-dev-container-port-ipython
104+
docker-dev-container-port-ipython:
105+
$(DOCKER-DEV-CONTAINER-PORT) ipython --no-autoindent
106+
107+
.PHONY: docker-container-port
108+
docker-container-port:
109+
$(DOCKER-CONTAINER-PORT)

‎.metadata/docker/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM serial_interface-dev
2+
WORKDIR /serial_interface_python
3+
4+
RUN pip install --user .
5+
6+
CMD ["bash"]

‎.metadata/docker/Dockerfile.dev

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# first stage
2+
FROM python:3.10-slim AS builder
3+
COPY requirements.txt .
4+
5+
# install dependencies to the local user directory (eg. /root/.local)
6+
RUN pip install --user -r requirements.txt
7+
RUN pip install --user ipython
8+
9+
# second unnamed stage
10+
FROM python:3.10-slim
11+
WORKDIR /serial_interface_python
12+
13+
# copy only the dependencies installation from the 1st stage image
14+
COPY --from=builder /root/.local /root/.local
15+
COPY ./ .
16+
17+
# update PATH environment variable
18+
ENV PATH=/root/.local/bin:$PATH
19+
20+
CMD ["bash"]

‎.metadata-python/emacs/init.el renamed to ‎.metadata/emacs/init.el

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
;; This file is generated automatically from metadata.org
1+
;; This file is generated automatically from metadata
22
;; File edits may be overwritten!
33
(require 'org)
4+
(require 'ox-org)
45

56
(eval-after-load "org"
67
'(require 'ox-gfm nil t))
@@ -17,7 +18,7 @@
1718
(error "INFILE must be an org file."))
1819
(org-babel-tangle-file org-file))
1920

20-
(defun export-org (org-file)
21+
(defun export-org-to-markdown (org-file)
2122
"Export org file to gfm file"
2223
(unless (string= "org" (file-name-extension org-file))
2324
(error "INFILE must be an org file."))
@@ -28,4 +29,9 @@
2829
(defun process-org (org-file)
2930
"Tangle and export org file"
3031
(progn (tangle-org org-file)
31-
(export-org org-file)))
32+
(export-org-to-markdown org-file)))
33+
34+
35+
(setq enable-local-variables nil)
36+
(setq tangle-external-files t)
37+
(setq python-package-dir (concat "../" "serial_interface"))
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
;; This file is generated automatically from metadata.org
1+
;; This file is generated automatically from metadata
22
;; File edits may be overwritten!
33
(list (channel
4+
(name 'guix-janelia)
5+
(url "https://github.com/guix-janelia/guix-janelia.git")
6+
(branch "main")
7+
(commit
8+
"00269482830083a52441bbacda39e1fb70fb017f"))
9+
(channel
410
(name 'guix)
511
(url "https://git.savannah.gnu.org/git/guix.git")
612
(branch "master")
713
(commit
8-
"eb329c946181557f3dd63195d4938592ef9f4f98")
14+
"cbd2db98954739db1cdda208e1667c5d50976bf1")
915
(introduction
1016
(make-channel-introduction
1117
"9edb3f66fd807b096b48283debdcddccfea34bad"
1218
(openpgp-fingerprint
13-
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
14-
(channel
15-
(name 'guix-janelia)
16-
(url "https://github.com/guix-janelia/guix-janelia.git")
17-
(branch "main")
18-
(commit
19-
"a082913f2dcfd0aa7d1922e780880505aaf3e2d9")))
19+
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))

‎.metadata-python/guix/guix.scm renamed to ‎.metadata/guix/guix.scm

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; This file is generated automatically from metadata.org
1+
;; This file is generated automatically from metadata
22
;; File edits may be overwritten!
33
(use-modules
44
(guix packages)
@@ -13,7 +13,6 @@
1313
(gnu packages python-xyz)
1414
(gnu packages version-control)
1515
(gnu packages ncurses)
16-
(guix-janelia packages python-janelia)
1716
(guix-janelia packages python-xyz))
1817

1918
(define %source-dir (dirname (dirname (dirname (current-filename)))))
@@ -35,6 +34,7 @@
3534
python-twine
3635
python-ipython))
3736
(propagated-inputs (list
37+
coreutils
3838
ncurses
3939
python-pyserial))
4040
(home-page "")

0 commit comments

Comments
 (0)
Please sign in to comment.