Building one directional valve
Solution 1:
To summarize the comments, it can be done but needs at least two z levels.
Z+1 Z
+++ ++7
+ + +7+
+P+ +++
+p+ +++
+ + +7+
+++ +7+
+: Wall
P: Pump output
p: Pump input
7: Water
Water will taken from south, and exits to the north. The diagonal gap is required to remove the pressure from the water stream, otherwise it would flood onto Z+1 level whenever possible. Because this slows the stream very much, in some cases it might be better to avoid the gap (water will only flood Z+1, not Z+2) or place it further downstream.
Can be combined with a water wheel for automatic operation.
Z+1 Z
+++ ++7
+w+ +7+
o-w+ +7+
|+w+ +7+
o-P+ +++
+p+ +++
+ + +7+
+++ +7+
+: Wall
P: Pump output
p: Pump input
7: Water
w: Water wheel
-, |: Axles
o: Gear
Might cause slight spillage of water around the upper axle though.