Skip to content

Commit f3eebd7

Browse files
committed
Merge branch 'main' into implements-options
2 parents 5999f10 + 15f4d8e commit f3eebd7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+703
-4742
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
paths:
66
- 'docs/**'
7+
- 'pyfpga/project.py'
78
branches:
89
- main
910
- dev

.github/workflows/lint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: 'lint'
22

33
on:
44
push:
5+
paths:
6+
- 'examples/**'
7+
- 'pyfpga/**'
8+
- 'tests/**'
59

610
jobs:
711
lint:
@@ -11,5 +15,5 @@ jobs:
1115
uses: actions/checkout@v4
1216
- name: Install dependencies
1317
run: pip install pycodestyle pylint
14-
- name: Run linters
18+
- name: Run linting
1519
run: make lint

.github/workflows/pypi.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish Package to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12'
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install setuptools wheel twine
22+
- name: Build package
23+
run: |
24+
python setup.py sdist bdist_wheel
25+
- name: Upload package to PyPI
26+
run: |
27+
twine upload dist/*
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,36 @@ name: 'test'
22

33
on:
44
push:
5+
paths:
6+
- 'examples/projects/**'
7+
- 'pyfpga/**'
8+
- 'tests/**'
59

610
jobs:
711
test:
812
strategy:
913
matrix:
10-
os: ['ubuntu']
14+
os: ['ubuntu', 'windows']
1115
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
16+
exclude:
17+
- os: 'windows'
18+
pyver: '3.8'
19+
- os: 'windows'
20+
pyver: '3.9'
21+
- os: 'windows'
22+
pyver: '3.10'
23+
- os: 'windows'
24+
pyver: '3.11'
1225
runs-on: ${{ matrix.os }}-latest
1326
name: ${{ matrix.os }} | ${{ matrix.pyver }}
1427
steps:
1528
- name: Checkout repository
1629
uses: actions/checkout@v4
17-
with:
18-
submodules: true
19-
fetch-depth: 0
2030
- name: Set up Python ${{ matrix.pyver }}
2131
uses: actions/setup-python@v5
2232
with:
2333
python-version: ${{ matrix.pyver }}
2434
- name: Install dependencies
2535
run: pip install . && pip install pytest
2636
- name: Run tests
27-
run: source tests/mocks/source-me.sh && make test
37+
run: make test

CHANGELOG.md

Lines changed: 0 additions & 90 deletions
This file was deleted.

LICENSE

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -619,56 +619,3 @@ Program, unless a warranty or assumption of liability accompanies a
619619
copy of the Program in return for a fee.
620620

621621
END OF TERMS AND CONDITIONS
622-
623-
How to Apply These Terms to Your New Programs
624-
625-
If you develop a new program, and you want it to be of the greatest
626-
possible use to the public, the best way to achieve this is to make it
627-
free software which everyone can redistribute and change under these terms.
628-
629-
To do so, attach the following notices to the program. It is safest
630-
to attach them to the start of each source file to most effectively
631-
state the exclusion of warranty; and each file should have at least
632-
the "copyright" line and a pointer to where the full notice is found.
633-
634-
PyFPGA
635-
Copyright (C) 2019 Rodrigo Alejandro Melo
636-
637-
This program is free software: you can redistribute it and/or modify
638-
it under the terms of the GNU General Public License as published by
639-
the Free Software Foundation, either version 3 of the License, or
640-
(at your option) any later version.
641-
642-
This program is distributed in the hope that it will be useful,
643-
but WITHOUT ANY WARRANTY; without even the implied warranty of
644-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645-
GNU General Public License for more details.
646-
647-
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <http://www.gnu.org/licenses/>.
649-
650-
Also add information on how to contact you by electronic and paper mail.
651-
652-
If the program does terminal interaction, make it output a short
653-
notice like this when it starts in an interactive mode:
654-
655-
PyFPGA Copyright (C) 2019 Rodrigo Alejandro Melo
656-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657-
This is free software, and you are welcome to redistribute it
658-
under certain conditions; type `show c' for details.
659-
660-
The hypothetical commands `show w' and `show c' should show the appropriate
661-
parts of the General Public License. Of course, your program's commands
662-
might be different; for a GUI interface, you would use an "about box".
663-
664-
You should also get your employer (if you work as a programmer) or school,
665-
if any, to sign a "copyright disclaimer" for the program, if necessary.
666-
For more information on this, and how to apply and follow the GNU GPL, see
667-
<http://www.gnu.org/licenses/>.
668-
669-
The GNU General Public License does not permit incorporating your program
670-
into proprietary programs. If your program is a subroutine library, you
671-
may consider it more useful to permit linking proprietary applications with
672-
the library. If this is what you want to do, use the GNU Lesser General
673-
Public License instead of this License. But first, please read
674-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
.PHONY: docs
44

5+
ifeq ($(OS),Windows_NT)
6+
PATH_SEP := ;
7+
else
8+
PATH_SEP := :
9+
endif
10+
export PATH := $(CURDIR)/tests/mocks$(PATH_SEP)$(PATH)
11+
512
all: docs lint test
613

714
docs:
@@ -13,7 +20,8 @@ lint:
1320
git diff --check --cached
1421

1522
test:
16-
pytest
23+
pytest -vv
24+
cd tests && bash regress.sh
1725

1826
clean:
1927
py3clean .

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,37 @@ For a comprehensive list of supported tools, features and limitations, please re
4949
5050
## Installation
5151

52-
PyFPGA requires Python>=3.8.
52+
> **NOTE:** PyFPGA requires Python >= 3.8.
5353
54-
At the moment, it's only available as a git repository hosted on GitHub. It can be installed with pip:
54+
PyFPGA can be installed in several ways:
55+
56+
1. From PyPi using pip:
57+
58+
```
59+
pip install pyfpga
60+
```
61+
62+
2. From the GitHub repository:
5563

5664
```
5765
pip install 'git+https://github.com/PyFPGA/pyfpga#egg=pyfpga'
5866
```
5967

60-
Alternatively, you can get a copy of the repository either through git clone or downloading a tarball/zipfile, and then:
68+
3. Clone/download the repository and install it manually:
6169

6270
```
6371
git clone https://github.com/PyFPGA/pyfpga.git
6472
cd pyfpga
6573
pip install -e .
6674
```
6775

68-
> With `-e` (`--editable`) your application is installed into site-packages via a kind of symlink.
69-
> That allows pulling changes through git or changing the branch, avoiding the need to reinstall the package.
76+
> **NOTE:** with `-e` (`--editable`), the application is installed into site-packages via a symlink, which allows you to pull changes through git or switch branches without reinstalling the package.
7077
7178
## Similar projects
7279

7380
* [edalize](https://github.com/olofk/edalize): an abstraction library for interfacing EDA tools.
74-
* [Hdlmake](https://ohwr.org/project/hdl-make): tool for generating multi-purpose makefiles for FPGA projects.
81+
* Firmware Framework ([FWK](https://gitlab.desy.de/fpgafw/fwk)): set of scripts and functions/procedures that combine all the input files needed to produce build.
7582
* HDL On Git ([Hog](https://gitlab.com/hog-cern/Hog)): a set of Tcl/Shell scripts plus a suitable methodology to handle HDL designs in a GitLab repository.
83+
* [Hdlmake](https://ohwr.org/project/hdl-make): tool for generating multi-purpose makefiles for FPGA projects.
7684
* IPbus Builder ([IPBB](https://github.com/ipbus/ipbb)): a tool for streamlining the synthesis, implementation and simulation of modular firmware projects over multiple platforms.
7785
* [tsfpga](https://github.com/tsfpga/tsfpga): a flexible and scalable development platform for modern FPGA projects.

docs/extending.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ Add support for the new tool
1818
pyfpga/factory.py # UPDATE
1919
pyfpga/helpers/prj2bit.py # UPDATE
2020
21-
Add tests and a tool mock-up
21+
Add tests and tools mock-ups
2222
----------------------------
2323

2424
.. code-block:: bash
2525
2626
tests/test_tools.py # UPDATE
27+
tests/regress.sh # UPDATE
2728
tests/support.py # UPDATE if exceptions are needed
2829
tests/mocks/<NEWCOMMAND>
2930
@@ -36,7 +37,6 @@ Add examples
3637
examples/sources/cons/<NEWBOARD>/clk.<EXT>
3738
examples/sources/cons/<NEWBOARD>/led.<EXT>
3839
examples/projects/<NEWTOOL>.py
39-
examples/projects/regress.sh # UPDATE
4040
examples/helpers/<NEWTOOL>.sh
4141
examples/hooks/<NEWTOOL>.py # OPTIONAL
4242
@@ -61,9 +61,7 @@ Verify the functionality
6161

6262
.. code-block:: bash
6363
64-
cd examples/projects/
65-
bash regress.sh <NEWTOOL>
66-
cd ../../tests/
64+
cd tests
6765
python3 support.py --tool <NEWTOOL>
6866
6967
Updated the documentation

0 commit comments

Comments
 (0)